question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add pipeK for monads

See original GitHub issue

Ramda has Kleisli composition via composeK and pipeK. We probably only need one of those.

It is worth considering instead a specification for Categories as suggested in https://github.com/fantasyland/fantasy-land/issues/208 and implementing a Kleisli type that exposes its own compose.

This would mean pipe would be sufficient if it were implemented in terms of compose.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (16 by maintainers)

github_iconTop GitHub Comments

3reactions
Avaqcommented, Apr 13, 2017
S.pipe(S.map(S.chain, [f, g, h]))
const pipeK = S.compose(S.pipe, S.map(S.chain))

I’m happy defining it myself for my sporadic use-cases. 🤷‍♂️

2reactions
davidchamberscommented, Apr 13, 2017

Since pipeK would exist only for convenience, we should compare usage examples. Let’s use this as the starting point:

S.pipe([S.chain(f), S.chain(g), S.chain(h)])

With pipeK:

S.pipeK([f, g, h])

With Kleisli:

S.pipe([S.Kleisli(f), S.Kleisli(g), S.Kleisli(h)])
Read more comments on GitHub >

github_iconTop Results From Across the Web

Monadic pipelines
This new monad holds the computed value, if the computation succeeded. It collates all errors, warnings, and messages. These are stored in step-by-step...
Read more >
All About Monads - HaskellWiki
All About Monads is a tutorial on monads and monad transformers and a walk-through of common monad instances. You can download a PDF...
Read more >
How to transform monads in a conduit pipeline? - Stack Overflow
I am trying to copy a file from disk to a File in MongoDB GridFS with the Database.MongoDB packages. main :: IO ()...
Read more >
Effortless Monad Transformers for Pipes, Conduit and more
Combining several independant counters or several pipes unilizing diverse monad transformers into a single pipeline is problematic however.
Read more >
Monads aren't as hard as you think - Bytes by Ying
No matter how complex your pipeline may get, you should only ever expect to get more Nothing types with a longer pipeline, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found