[Haskell-cafe] Functor instance for FunPB

MarLinn monkleyon at gmail.com
Sat May 6 18:25:13 UTC 2017


>   mappend pb1 pb2 = FunPB $ \n -> (,) n $ msum . (<$>) (uncurry (flip 
> const).((flip runFunPB) n)) $ [pb1,pb2]

This cracks me up. Well played. Well played indeed.

Well all the things you need are right here in this line, right? I mean 
you sent it because you want to show us what you know, right? There's 
higher order functions, there's mapping and folding and currying of 
different kinds and everything. So what's missing?



More information about the Haskell-Cafe mailing list