0.0.3 • Published 7 years ago
pull-fmap v0.0.3
pull-fmap
fmap function for mapping over functors in a pull stream
This is a blatant rip of code from pull-stream/pull-stream.
pull(
pull.values([ Just('Hello'), Juts('World'), Nothing ])
fmap(x => x.toUpperCase()),
pull.log()
)
// Just(HELLO)
// Just(WORLD)
// Nothing
Installation
$ npm install --save pull-fmap
Usage
fmap = require('pull-fmap')
fmap((data) => data)
fmap(fn)
returns a through stream that calls the given fn
for each functor's value, in the same order as before. The type of the returned value should be a functor of the same type:
fmap :: Functor f => f a ~> (a -> b) -> f b
Install
With npm installed, run
$ npm install pull-fmap