Copyright | (c) Marcin Mrotek, 2014 |
---|---|
License | BSD3 |
Maintainer | marcin.jan.mrotek@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Extensions |
|
Operations on type-level lists and tuples, together with their curried versions - the more apostrophes, the more arguments are missing from the function.
Curried type functions can be evaluated by the Apply
type family from Data.Singletons.
- type family Map (f :: TyFun a b -> *) (xs :: [a]) where ...
- data Map'' :: TyFun (TyFun a b -> *) (TyFun [a] [b] -> *) -> * where
- data Map' :: (TyFun a b -> *) -> TyFun [a] [b] -> * where
- type family ZipWith (f :: TyFun a (TyFun b c -> *) -> *) (xs :: [a]) (ys :: [b]) where ...
- data ZipWith''' :: TyFun (TyFun a (TyFun b c -> *) -> *) (TyFun [a] (TyFun [b] [c] -> *) -> *) -> * where
- ZipWith''' :: ZipWith''' f
- data ZipWith'' :: (TyFun a (TyFun b c -> *) -> *) -> TyFun [a] (TyFun [b] [c] -> *) -> * where
- data ZipWith' :: (TyFun a (TyFun b c -> *) -> *) -> [a] -> TyFun [b] [c] -> * where
- type family Length xs where ...
- lengthVal :: forall sing xs. KnownNat (Length xs) => sing xs -> Integer
- data Length' :: TyFun [a] Nat -> * where
- type family Insert a xs where ...
- data Insert'' :: TyFun k (TyFun [k] [k] -> *) -> * where
- data Insert' :: k -> TyFun [k] [k] -> * where
- type family Union xs ys where ...
- data Union'' :: TyFun [k] (TyFun [k] [k] -> *) -> * where
- data Union' :: [k] -> TyFun [k] [k] -> * where
- type family Remove x ys where ...
- data Remove'' :: TyFun k (TyFun [k] [k] -> *) -> * where
- data Remove' :: k -> TyFun [k] [k] -> * where
- type family Difference xs ys where ...
- data Difference'' :: TyFun [k] (TyFun [k] [k] -> *) -> * where
- Difference'' :: Difference'' f
- data Difference' :: [k] -> TyFun [k] [k] -> * where
- Difference' :: Difference' xs f
- type family ReverseAcc xs acc where ...
- type family Reverse xs where ...
- data Reverse' :: TyFun [k] [k] -> * where
- type family Find x ys where ...
- data Find'' :: TyFun k (TyFun [k] Bool -> *) -> * where
- data Find' :: k -> TyFun [k] Bool -> * where
- type family Intersection xs ys where ...
- data Intersection'' :: TyFun [k] (TyFun [k] [k] -> *) -> * where
- data Intersection' :: [k] -> TyFun [k] [k] -> * where
- Intersection' :: Intersection' xs f
- type family Distinct xs ys where ...
- data Distinct'' :: TyFun [k] (TyFun [k] Bool -> *) -> * where
- Distinct'' :: Distinct'' f
- data Distinct' :: [k] -> TyFun [k] Bool -> * where
- type family Lookup (x :: k) (l :: [(k, a)]) where ...
- data Lookup'' :: TyFun k (TyFun [(k, a)] a -> *) -> * where
- data Lookup' :: k -> TyFun [(k, a)] a -> * where
- type family Fst k where ...
- data Fst' :: TyFun (a, b) a -> * where
- type family Snd k where ...
- data Snd' :: TyFun (a, b) b -> * where
- type family AsFst a b where ...
- data AsFst'' :: TyFun a (TyFun b (a, b) -> *) -> * where
- data AsFst' :: a -> TyFun b (a, b) -> * where
- type family AsSnd a b where ...
- data AsSnd'' :: TyFun a (TyFun b (b, a) -> *) -> * where
- data AsSnd' :: a -> TyFun b (b, a) -> * where
- type family Swap k where ...
- data Swap' :: TyFun (a, b) (b, a) -> * where
Documentation
type family Map (f :: TyFun a b -> *) (xs :: [a]) where ... Source #
Maps a curried type function over a type list.
type family ZipWith (f :: TyFun a (TyFun b c -> *) -> *) (xs :: [a]) (ys :: [b]) where ... Source #
Zip two list with a curried two-argument type function.
data ZipWith''' :: TyFun (TyFun a (TyFun b c -> *) -> *) (TyFun [a] (TyFun [b] [c] -> *) -> *) -> * where Source #
ZipWith''' :: ZipWith''' f |
data ZipWith'' :: (TyFun a (TyFun b c -> *) -> *) -> TyFun [a] (TyFun [b] [c] -> *) -> * where Source #
type family Length xs where ... Source #
Length of a type-level list, as a type-level natural number.
lengthVal :: forall sing xs. KnownNat (Length xs) => sing xs -> Integer Source #
Length of a type-level list, as an integer.
type family Difference xs ys where ... Source #
Set difference over type lists.
Difference '[] ys = ys | |
Difference (x ': xs) ys = Remove x (Difference xs ys) |
data Difference'' :: TyFun [k] (TyFun [k] [k] -> *) -> * where Source #
Difference'' :: Difference'' f |
data Difference' :: [k] -> TyFun [k] [k] -> * where Source #
Difference' :: Difference' xs f |
type Apply [a] [a] (Difference' a xs) ys Source # | |
type family ReverseAcc xs acc where ... Source #
Helper type family for Reverse
.
ReverseAcc '[] acc = acc | |
ReverseAcc (x ': xs) acc = ReverseAcc xs (x ': acc) |
type family Intersection xs ys where ... Source #
Type list intersection.
Intersection '[] ys = '[] | |
Intersection (x ': xs) (x ': ys) = x ': Intersection xs ys | |
Intersection (x ': xs) (y ': ys) = If (Find x ys) (x ': Intersection xs (y ': ys)) (Intersection xs (y ': ys)) |
data Intersection' :: [k] -> TyFun [k] [k] -> * where Source #
Intersection' :: Intersection' xs f |
type Apply [a] [a] (Intersection' a xs) ys Source # | |
data Distinct'' :: TyFun [k] (TyFun [k] Bool -> *) -> * where Source #
Distinct'' :: Distinct'' f |