[Haskell-cafe] Question on nested fmaps.

Roman Cheplyaka roma at ro-che.info
Thu Dec 31 08:13:11 UTC 2015


This law implies from fmap id = id, see
https://www.fpcomplete.com/user/edwardk/snippets/fmap

On 12/31/2015 03:27 AM, Adam Bergmark wrote:
> This is one of the functor laws, the other one being `fmap id = id'. If
> it doesn't hold your type *should* not have a Functor instance, but the
> compiler doesn't verify this for you.
> 
> HTH,
> Adam
> 
> On Thu, Dec 31, 2015 at 2:15 AM, David Banas <capn.freako at gmail.com
> <mailto:capn.freako at gmail.com>> wrote:
> 
>     Is this true, in general?:
> 
>         fmap h (fmap g f) == fmap (h . g) f
> 
> 
>     Is there a simple proof?
> 
>     Thanks,
>     -db
> 
> 
>     _______________________________________________
>     Haskell-Cafe mailing list
>     Haskell-Cafe at haskell.org <mailto:Haskell-Cafe at haskell.org>
>     http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> 
> 
> 
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151231/d3fc34f7/attachment.sig>


More information about the Haskell-Cafe mailing list