GithubHelp home page GithubHelp logo

monocats's Introduction

Monocats

Monocats provides mono-functor and similar instances from mono-traversable for Scala developers using cats.

Installation

In build.sbt:

libraryDependencies += "com.thoughtbot" % "monocats_2.12" % "0.1.1"

Synopsis

Monocats provides mono instances which are similar to their cats counterparts, but don't allow the parameterized type to change during mapping, which allows instances to be defined for more types.

For example, you can't define a Functor instance for String, because String does not have a parameterized type, and mapping from a Char to an Int can't produce a new String. However, you can define a MonoFunctor instance, because mapping must preserve the Char type:

new MonoFunctor[String] {
  type Element = Char

  def map(string: String)(f: Char => Char): String = string.map(f)
}

Mono instances can also be defined or derived for value classes, which allows generic extracting, lifting, and mapping.

See the Scaladoc for more details.

Contributing

Please see CONTRIBUTING.md.

License

Monocats is Copyright © 2017 thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.

monocats's People

Contributors

jferris avatar mike-burns avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.