mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
Lift Listable through Listable2.
This commit is contained in:
parent
6db5cf152a
commit
fe6a0852c5
@ -11,6 +11,7 @@ module Data.Functor.Listable
|
|||||||
, Listable1(..)
|
, Listable1(..)
|
||||||
, tiers1
|
, tiers1
|
||||||
, Listable2(..)
|
, Listable2(..)
|
||||||
|
, tiers2
|
||||||
, liftCons1
|
, liftCons1
|
||||||
) where
|
) where
|
||||||
|
|
||||||
@ -27,6 +28,10 @@ tiers1 = liftTiers tiers
|
|||||||
class Listable2 l where
|
class Listable2 l where
|
||||||
liftTiers2 :: [[a]] -> [[b]] -> [[l a b]]
|
liftTiers2 :: [[a]] -> [[b]] -> [[l a b]]
|
||||||
|
|
||||||
|
tiers2 :: (Listable a, Listable b, Listable2 l) => [[l a b]]
|
||||||
|
tiers2 = liftTiers2 tiers tiers
|
||||||
|
|
||||||
|
|
||||||
liftCons1 :: [[a]] -> (a -> b) -> [[b]]
|
liftCons1 :: [[a]] -> (a -> b) -> [[b]]
|
||||||
liftCons1 tiers f = mapT f tiers `addWeight` 1
|
liftCons1 tiers f = mapT f tiers `addWeight` 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user