[Haskell-cafe] Seeking help to generalize this ..

Debasish Ghosh ghosh.debasish at gmail.com
Sat Feb 1 18:54:26 UTC 2020


Hi -

How can I generalize the following pattern to an arbitrary list of
functions ?

compose :: (Monad m) => (Foo -> m Foo) -> (Foo -> m Foo) -> (Foo -> m Foo)
-> Foo -> m Foo
compose f1 f2 f3 acc = do
  a <- f1 acc
  b <- f2 a
  f3 b

Any help please ..
regards.

-- 
Debasish Ghosh
http://manning.com/ghosh2
http://manning.com/ghosh

Twttr: @debasishg
Blog: http://debasishg.blogspot.com
Code: http://github.com/debasishg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20200202/2a0561ae/attachment.html>


More information about the Haskell-Cafe mailing list