[Haskell-cafe] Monad fold
Lyndon Maydwell
maydwell at gmail.com
Tue Apr 16 15:50:50 CEST 2013
Yep. I was backstabbed by ghci seemingly having no issue with my definition
when I asked for the type.
On Tue, Apr 16, 2013 at 9:49 PM, Tom Ellis <
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
> On Tue, Apr 16, 2013 at 01:53:19PM +0100, Oliver Charles wrote:
> > On 04/16/2013 01:47 PM, Lyndon Maydwell wrote:
> > >You could do:
> > >
> > >runKleisli . mconcat . map Kleisli :: Monoid (Kleisli m a b) => [a
> > >-> m b] -> a -> m b
> > >
> > >Would that work for you?
> > I can't find an instance for Monoid (Kleisli m a b) in `base`, so
> > presumably the author would also have to write this instance? If so
> > - would that really be any different to using that fold?
>
> It doesn't make sense anyway. It would have to be "Kleisli m a a" which
> would presumably require a newtype.
>
> Tom
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130416/9e71a291/attachment.htm>
More information about the Haskell-Cafe
mailing list