Crocks

  • Documentation
Docs Menu
  • Getting Started
  • Crocks
    • Arrow
    • Async
    • Const
    • Either
    • Equiv
    • Identity
    • Maybe
    • Pair
    • Pred
    • Reader
    • ReaderT
    • Result
    • State
    • Tuple
  • Monoids
    • All
    • Any
    • Assign
    • Endo
    • First
    • Last
    • Max
    • Min
    • Prod
    • Sum
  • Functions
    • Combinators
    • Helpers
    • Logic Functions
    • Predicate Functions
    • Point-free Functions
    • Transformation Functions

Crocks

The crocks are the heart and soul of this library. This is where you will find all your favorite ADT's you have grown to love. They include gems such as:Maybe, Either and IO, to name a few. They are usually just a simple constructor that takes either a function or value (depending on the type) and will return you a "container" that wraps whatever you passed it. Each container provides a variety of functions that act as the operations you can do on the contained value. There are many types that share the same function names, but what they do from type to type may vary.

CrockConstructorInstance
Arrowidboth, compose, contramap,first, map, promap, runWith, second
AsyncRejected, Resolved, all, resolveAfter, rejectAfter, fromNode, fromPromise, ofalt, ap, bichain, bimap, chain, coalesce, fork, map, of, race, swap, toPromise
Constempty, ofap, concat, empty, equals, map, of, valueOf
EitherLeft, Right, ofalt, ap, bichain, bimap, chain, coalesce, concat, either, equals, map, of, sequence, swap, traverse
Equivemptyconcat, contramap, compareWith, valueOf
Identityofap, chain, concat, equals, map, of, sequence, traverse, valueOf
IOofap, chain, map, of, run
Listempty, fromArray, ofap, chain, concat, cons, empty, equals, filter, fold, foldMap, head, init, last, map, of, reduce, reduceRight, reject, sequence, tail, toArray, traverse, valueOf
MaybeNothing, Just, of, zeroalt, ap, bichain, chain, coalesce, concat, equals, either, map, of, option, sequence, traverse, zero
Pair---ap, bimap, chain, concat, equals, extend, fst, map, merge, sequence, snd, swap, traverse, toArray
Pred *emptyconcat, contramap, runWith, valueOf
Readerask, ofap, chain, map, runWith
ReaderTask, lift, liftFn, ofap, chain, map, runWith
ResultErr, Ok, ofalt, ap, bichain, bimap, chain, coalesce, concat, either, equals, map, of, sequence, swap, traverse
Staridboth, compose, contramap, map, promap, runWith
Stateget, modify, of, putap, chain, evalWith, execWith, map, runWith
Tuple---concat, equals, map, mapAll, merge, project, toArray
Unitempty, ofap, chain, concat, empty, equals, map, of, valueOf
Writerofap, chain, equals, log, map, of, read, valueOf

* based on this article

Contribute on Github! Edit this section.