Denful/pipe: A composable version of Nix `lib.pipe` (`|>`)

GitHub - denful/pipe: A composable version of Nix `lib.pipe` (`|>`) for any freer monad · GitHub is an small replacement for lib.pipe that allow proper functional composition. Out of the box it works as a monadic-do over the Id monad but it supports other monad instances, it only needs pure and bind. This was born after a chat with friends about the experimental pipe operator and how it would be actually useful to have it be generic like Scala or Haskell do notations.

9 Likes

What would you do with regards to the experimental pipe operator if you called the shots?

1 Like

I’d make it overridable like how angle brackets are actually syntax for lexical scoped __findFile. If the pipe operator was just special syntax for a __pipe that we can set locally. that would be a good first step.

Wait, don’t you consider this feature of overridable operators an anti-feature? Isn’t it like “yes, it’s possible but shouldn’t be relied upon”?

1 Like

My thinking was that making it overridable is the easiest path to have user generic pipes otherwise the runtime would have knowledge of monads and such things. I was just thinking of the fastest path, but I don’t know if that path is the correct one according to the interpreter restrictions.