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

On Fri, Aug 17, 2018 at 8:41 AM <beginners-request@haskell.org> wrote:
Send Beginners mailing list submissions to
        beginners@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@haskell.org

You can reach the person managing the list at
        beginners-owner@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@gmail.com>
To: beginners@haskell.org
Subject: [Haskell-beginners] Bound library questions
Message-ID:
        <CA+pBo5HVraf_8jbs15bR6QAy1S7=z_u-3KBwT=c3sqkAgc0m5Q@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@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 122, Issue 6
*****************************************