tfausak / flow

:droplet: Write more understandable Haskell.
https://hackage.haskell.org/package/flow
MIT License
198 stars 10 forks source link

Flow operators for `Functor` and `Applicative` #24

Closed vanceism7 closed 1 year ago

vanceism7 commented 1 year ago

I was working through this lib and realized, it might be nice to have some directional operators for functor and applicative as well.

Having the <$> pop up really uglies up the code flow.

Maybe something like <$| for fmap |$> for flip fmap. <*| for apply (I think thats the name of <*>) |*> for flip apply?

Just spit balling here, but I think those would be some nice additions to make the lib a slight bit more complete. Luckily Monad already has nice directional operators.

Thanks!

vanceism7 commented 1 year ago

OH blah, sorry! Just saw https://github.com/tfausak/flow/issues/13. I should've looked harder before making an issue. Ill just go ahead and close this...

tfausak commented 1 year ago

No problem at all! I'm glad you found that earlier issue.

Since Flow doesn't have these operators, I think you can get them from either functor-monadic or op.