[Haskell-cafe] Why Kleisli composition is not in the Monad signature?

Gershom Bazerman gershomb at gmail.com
Fri Nov 30 18:21:48 CET 2012

On 11/30/12 10:44 AM, Dan Doel wrote:
> Lists! The finite kind.
> This could mean Seq for instance.
> On Nov 30, 2012 9:53 AM, "Brent Yorgey" <byorgey at seas.upenn.edu 
> <mailto:byorgey at seas.upenn.edu>> wrote:
>     Any data type which admits structures of arbitrary but *only finite*
>     size has a natural "zippy" Apply instance but no Applicative (since
>     pure would have to be an infinite structure).  The Map instance I
>     mentioned above falls in this category.  Though I guess I'm having
>     trouble coming up with other examples, but I'm sure some exist.  Maybe
>     Edward knows of other examples.

Another common case would be an embedded DSL representing code in a 
different language, targeting a different platform (or even an FPGA or 
the like), etc. You can apply `OtherLang (a -> b)` to an `OtherLang a` 
and get an `OtherLang b`, but you clearly can't promote (or "lower," I 
guess) an arbitrary Haskell function into a function in your target 
language. This is the same reason that GArrows remove the `arr` function 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121130/e92191ef/attachment.htm>

More information about the Haskell-Cafe mailing list