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) wherefmap f (Scope a) = Scope (fmap (fmap (fmap f)) a){-# INLINE fmap #-}-- | @'toList'@ is provides a list (with duplicates) of the free variablesinstance Foldable f => Foldable (Scope b f) wherefoldMap f (Scope a) = foldMap (foldMap (foldMap f)) a{-# INLINE foldMap #-}instance Traversable f => Traversable (Scope b f) wheretraverse f (Scope a) = Scope <$> traverse (traverse (traverse f)) a{-# INLINE traverse #-}
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners