mirror of
https://github.com/github/semantic.git
synced 2025-01-03 04:51:57 +03:00
Add weight to every layer of Free/Cofree.
This commit is contained in:
parent
c275b0fc04
commit
ad81f4f605
@ -114,7 +114,7 @@ instance Listable2 These where
|
||||
liftTiers2 this that = liftCons1 this This \/ liftCons1 that That \/ liftCons2 this that These
|
||||
|
||||
instance Listable1 f => Listable2 (CofreeF f) where
|
||||
liftTiers2 annotationTiers recurTiers = liftCons2 annotationTiers (liftTiers recurTiers) (:<)
|
||||
liftTiers2 annotationTiers recurTiers = liftCons2 annotationTiers (liftTiers recurTiers `addWeight` 1) (:<)
|
||||
|
||||
instance (Listable1 f, Listable a) => Listable1 (CofreeF f a) where
|
||||
liftTiers = liftTiers2 tiers
|
||||
@ -124,7 +124,7 @@ instance (Functor f, Listable1 f) => Listable1 (Cofree f) where
|
||||
where go = liftCons1 (liftTiers2 annotationTiers go) cofree
|
||||
|
||||
instance Listable1 f => Listable2 (FreeF f) where
|
||||
liftTiers2 pureTiers recurTiers = liftCons1 pureTiers Pure \/ liftCons1 (liftTiers recurTiers) Free
|
||||
liftTiers2 pureTiers recurTiers = liftCons1 pureTiers Pure \/ liftCons1 (liftTiers recurTiers `addWeight` 1) Free
|
||||
|
||||
instance (Listable1 f, Listable a) => Listable1 (FreeF f a) where
|
||||
liftTiers = liftTiers2 tiers
|
||||
|
Loading…
Reference in New Issue
Block a user