[Haskell-beginners] Beginners Digest, Vol 122, Issue 6

Anthony Lee anthonynlee at gmail.com
Fri Aug 17 13:21:47 UTC 2018


The source code is here: https://github.com/ekmett/bound/

On Fri, Aug 17, 2018 at 8:41 AM <beginners-request at haskell.org> wrote:

> Send Beginners mailing list submissions to
>         beginners at haskell.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> or, via email, send a message with subject or body 'help' to
>         beginners-request at haskell.org
>
> You can reach the person managing the list at
>         beginners-owner at haskell.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Beginners digest..."
>
>
> Today's Topics:
>
>    1.  Bound library questions (Anthony Lee)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 17 Aug 2018 06:46:52 -0400
> From: Anthony Lee <anthonynlee at gmail.com>
> To: beginners at haskell.org
> Subject: [Haskell-beginners] Bound library questions
> Message-ID:
>         <CA+pBo5HVraf_8jbs15bR6QAy1S7=z_u-3KBwT=
> c3sqkAgc0m5Q at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> In Scope.hs there are some functions I feel difficult to understand,
> Why fmap/foldmap/traverse is applied three times?
>
> instance Functor f => Functor (Scope b f) where
> fmap f (Scope a) = Scope (fmap (fmap (fmap f)) a)
> {-# INLINE fmap #-}
>
> -- | @'toList'@ is provides a list (with duplicates) of the free variables
> instance Foldable f => Foldable (Scope b f) where
> foldMap f (Scope a) = foldMap (foldMap (foldMap f)) a
> {-# INLINE foldMap #-}
>
> instance Traversable f => Traversable (Scope b f) where
> traverse f (Scope a) = Scope <$> traverse (traverse (traverse f)) a
> {-# INLINE traverse #-}
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.haskell.org/pipermail/beginners/attachments/20180817/429114c8/attachment-0001.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
> ------------------------------
>
> End of Beginners Digest, Vol 122, Issue 6
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20180817/2112c0e7/attachment.html>


More information about the Beginners mailing list