type-combinators-0.2.4.3: A collection of data types for type-level programming

Safe Haskell None Haskell2010

Data.Type.Product.Env

Documentation

newtype Env k v ps Source #

Constructors

 Env FieldsgetEnv :: Prod (k :*: v) ps

Instances

 IxFunctor1 k [(m, k)] (IxList k (m, k) (IxSecond m k k ((:~:) k))) (Env k m k1) Source # Methodsimap1 :: (forall a. i b a -> f a -> g a) -> t f b -> t g b Source # Functor1 [(k1, k)] k (Env k k1 k2) Source # Methodsmap1 :: (forall a. f a -> g a) -> t f b -> t g b Source #

type family Member (x :: k) (ps :: [(k, v)]) :: Bool where ... Source #

Equations

 Member x Ø = False Member x ('(y, a) :< ps) = (x == y) || Member x ps

member' :: BoolEquality k => k x -> Env k v ps -> Boolean (Member x ps) Source #

type family Lookup (x :: k) (ps :: [(k, v)]) :: Maybe v where ... Source #

Equations

 Lookup x Ø = Nothing Lookup x ('(y, a) :< ps) = If (x == y) (Just a) (Lookup x ps)

lookup' :: BoolEquality k => k x -> Env k v ps -> Option v (Lookup x ps) Source #

type family Insert (x :: k) (a :: v) (ps :: [(k, v)]) :: [(k, v)] where ... Source #

Equations

 Insert x a Ø = '['(x, a)] Insert x a ('(y, b) :< ps) = If (x == y) ('(x, a) :< ps) ('(y, b) :< Insert x a ps)

insert' :: BoolEquality k => k x -> v a -> Env k v ps -> Env k v (Insert x a ps) Source #

type family Delete (x :: k) (ps :: [(k, v)]) :: [(k, v)] where ... Source #

Equations

 Delete x Ø = Ø Delete x ('(y, a) :< ps) = If (x == y) ps ('(y, a) :< Delete x ps)

delete' :: BoolEquality k => k x -> Env k v ps -> Env k v (Delete x ps) Source #

type family Difference (ps :: [(k, v)]) (qs :: [(k, w)]) :: [(k, v)] where ... Source #

Equations

 Difference ps Ø = ps Difference ps ('(x, a) :< qs) = Delete x (Difference ps qs)

difference' :: BoolEquality k => Env k v ps -> Env k w qs -> Env k v (Difference ps qs) Source #

(.\\) :: BoolEquality k => Env k v ps -> Env k w qs -> Env k v (Difference ps qs) Source #

type family Union (ps :: [(k, v)]) (qs :: [(k, v)]) :: [(k, v)] where ... Source #

Equations

 Union ps Ø = ps Union ps ('(x, a) :< qs) = Insert x a (Union ps qs)

union' :: BoolEquality k => Env k v ps -> Env k v qs -> Env k v (Union ps qs) Source #

type family Intersection (ps :: [(k, v)]) (qs :: [(k, w)]) :: [(k, v)] where ... Source #

Equations

 Intersection Ø qs = Ø Intersection ('(x, a) :< ps) qs = If (Member x qs) ('(x, a) :< Intersection ps qs) (Intersection ps qs)

intersection' :: BoolEquality k => Env k v ps -> Env k w qs -> Env k v (Intersection ps qs) Source #

ixList :: Index as a -> i a b -> IxList i as b Source #