1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

📝 Generics.

This commit is contained in:
Rob Rix 2020-01-13 13:45:24 -05:00
parent 281d62ba3d
commit 37ead274fb
No known key found for this signature in database
GPG Key ID: 2BE643E01DC032AE

View File

@ -150,6 +150,11 @@ instance GTraversable1 c U1 where
gtraverse1 _ _ _ = pure U1 gtraverse1 _ _ _ = pure U1
-- | @'Generics' t@ has a 'Traversable1' instance when @'Rep1' t@ has a 'GTraversable1' instance, making this convenient for applying 'traverse1' to 'Generic1' types lacking 'Traversable1' instances:
--
-- @
-- 'getGenerics' '<$>' 'traverse1' f g ('Generics' t) = 'to1' '<$>' 'gtraverse1' f g ('from1' t)
-- @
newtype Generics t a = Generics { getGenerics :: t a } newtype Generics t a = Generics { getGenerics :: t a }
deriving (Foldable, Functor, Traversable) deriving (Foldable, Functor, Traversable)