garyb / purescript-indexed-monad

MIT License
21 stars 11 forks source link

Sequencing of actions #4

Closed owickstrom closed 7 years ago

owickstrom commented 7 years ago

Right now one has to use any of the following to sequence indexed monadic actions and discarding return values:

foo :>>= \_ -> bar` -- or `const bar`

foo `mbind` \_ -> bar -- or `const bar`

do foo
   bar
   where bind = ibind

If we had IxApply, we could implement :*>, corresponding to *> from Apply. That would take us down the path of implementing the whole type class hierarchy (Bind, Applicative, Apply, Functor, more?).

foo :*> bar

We could perhaps also add :>>, like >> in Haskell's prelude, and just have it defined for only for IxMonad.

foo :>> bar
owickstrom commented 7 years ago

Could maybe be closed by https://github.com/garyb/purescript-indexed-monad/pull/5?

garyb commented 7 years ago

Closed by #5 for now, but I guess IxApply etc. will probably be good to have in the long run :)