mirror of
https://github.com/github/semantic.git
synced 2024-11-28 18:23:44 +03:00
Rename GFold1 to GFoldable1.
This commit is contained in:
parent
09f294a70d
commit
03635d00a2
@ -109,5 +109,5 @@ docComment _ _ = Nothing
|
||||
firstLine :: Source -> Text
|
||||
firstLine = T.take 180 . T.takeWhile (/= '\n') . toText
|
||||
|
||||
instance (Generic1 t, Tags.GFold1 ToTags (Rep1 t)) => ToTagsBy 'Generic t where
|
||||
instance (Generic1 t, Tags.GFoldable1 ToTags (Rep1 t)) => ToTagsBy 'Generic t where
|
||||
tags' = getAp . Tags.gfoldMap1 @ToTags (Ap . tags) . from1
|
||||
|
@ -4,7 +4,7 @@ module Tags.Taggable.Precise
|
||||
, Tags
|
||||
, ToTags(..)
|
||||
, yield
|
||||
, GFold1(..)
|
||||
, GFoldable1(..)
|
||||
) where
|
||||
|
||||
import Control.Effect.Reader
|
||||
@ -40,34 +40,34 @@ yield :: (Carrier sig m, Member (Writer Tags) sig) => Tag -> m ()
|
||||
yield = tell . Endo . (:)
|
||||
|
||||
|
||||
class GFold1 c t where
|
||||
class GFoldable1 c t where
|
||||
gfoldMap1
|
||||
:: Monoid b
|
||||
=> (forall f . c f => f a -> b)
|
||||
-> t a
|
||||
-> b
|
||||
|
||||
instance GFold1 c f => GFold1 c (M1 i c' f) where
|
||||
instance GFoldable1 c f => GFoldable1 c (M1 i c' f) where
|
||||
gfoldMap1 alg = gfoldMap1 @c alg . unM1
|
||||
|
||||
instance (GFold1 c f, GFold1 c g) => GFold1 c (f :*: g) where
|
||||
instance (GFoldable1 c f, GFoldable1 c g) => GFoldable1 c (f :*: g) where
|
||||
gfoldMap1 alg (f :*: g) = gfoldMap1 @c alg f <> gfoldMap1 @c alg g
|
||||
|
||||
instance (GFold1 c f, GFold1 c g) => GFold1 c (f :+: g) where
|
||||
instance (GFoldable1 c f, GFoldable1 c g) => GFoldable1 c (f :+: g) where
|
||||
gfoldMap1 alg (L1 l) = gfoldMap1 @c alg l
|
||||
gfoldMap1 alg (R1 r) = gfoldMap1 @c alg r
|
||||
|
||||
instance GFold1 c (K1 R t) where
|
||||
instance GFoldable1 c (K1 R t) where
|
||||
gfoldMap1 _ _ = mempty
|
||||
|
||||
instance GFold1 c Par1 where
|
||||
instance GFoldable1 c Par1 where
|
||||
gfoldMap1 _ _ = mempty
|
||||
|
||||
instance c t => GFold1 c (Rec1 t) where
|
||||
instance c t => GFoldable1 c (Rec1 t) where
|
||||
gfoldMap1 alg (Rec1 t) = alg t
|
||||
|
||||
instance (Foldable f, GFold1 c g) => GFold1 c (f :.: g) where
|
||||
instance (Foldable f, GFoldable1 c g) => GFoldable1 c (f :.: g) where
|
||||
gfoldMap1 alg = foldMap (gfoldMap1 @c alg) . unComp1
|
||||
|
||||
instance GFold1 c U1 where
|
||||
instance GFoldable1 c U1 where
|
||||
gfoldMap1 _ _ = mempty
|
||||
|
Loading…
Reference in New Issue
Block a user