Wondering what’s next for npm?Check out our public roadmap! »

rsite-funjs

1.0.20 • Public • Published

funjs

functional javascript

ongoing work.

This package aims to help with my parser combinator stuff (just)

const {
  patchPrimitives,//patch primitive data types
  curry,//js curry style
  id, fcomp, fchain, constant, flip, cons,//Functional
  empty, append, mconcat,//Monoid
  head, tail,//List
  map,//Functor
  pure, mbind,//Monad
  Pair, fst, snd,//Pair (tupple)
  Maybe, isMaybe, Nothing, isNothing, Just, isJust, fromJust,//Maybe
  isEither, Left, isLeft, fromLeft, Right, isRight, fromRight,//Either
  foldable, foldr, foldl, foldr1, foldl1, foldMap,//foldable
}=require("rsite-funjs");

//must patch primitive data-types so that we can do head([1]) or cons(1,[])
//among many other things
patchPrimitives(
  Function().__proto__,
  String().__proto__,
  Array().__proto__,
  Object().__proto__,
)

Install

npm i rsite-funjs

DownloadsWeekly Downloads

0

Version

1.0.20

License

MIT

Unpacked Size

21.8 kB

Total Files

20

Last publish

Collaborators

  • avatar