Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.HeteroParList
Synopsis
- type L as = PL Id as
- pattern (:*) :: a -> L as -> L (a ': as)
- newtype Id a = Id a
- type LL a ds = PL (Dummy a) ds
- type LL' a n = PL (Dummy a) (Dummies n)
- pattern (:*.) :: a -> LL a ds -> LL a ('() ': ds)
- newtype Dummy a (d :: ()) = Dummy a
- type family Dummies n where ...
- type family ToDummies xs where ...
- data PL (t :: k -> Type) (ss :: [k]) where
- type PL2 t = PL (PL t)
- type PL3 t = PL (PL2 t)
- type PL4 t = PL (PL3 t)
- pattern Singleton :: t s -> PL t '[s]
- pattern Singleton2 :: t s -> PL2 t '['[s]]
- pattern Singleton3 :: t s -> PL3 t '['['[s]]]
- pattern Singleton4 :: t s -> PL4 t '['['['[s]]]]
- class FromList (ss :: [k]) where
- toList :: (forall (s :: k). t s -> a) -> PL t ss -> [a]
- toList2 :: (forall (s :: k). t s -> a) -> PL2 t sss -> [[a]]
- toList3 :: (forall (s :: k). t s -> a) -> PL3 t ssss -> [[[a]]]
- toListM :: Applicative m => (forall (s :: k). t s -> m a) -> PL t ss -> m [a]
- toListM2 :: Applicative m => (forall (s :: k). t s -> m a) -> PL2 t sss -> m [[a]]
- toListM3 :: Applicative m => (forall (s :: k). t s -> m a) -> PL3 t sss -> m [[[a]]]
- toListM_ :: Applicative m => (forall (s :: k). t s -> m a) -> PL t ss -> m ()
- toListM2_ :: Applicative m => (forall (s :: k). t s -> m a) -> PL2 t ss -> m ()
- toListM3_ :: Applicative m => (forall (s :: k). t s -> m a) -> PL3 t ss -> m ()
- class ToListT2 k1 k2 (ss :: [(k1, k2)]) where
- class ToListT3 k1 k2 k3 (ss :: [(k1, k2, k3)]) where
- zipToList :: (forall (s :: k) (s' :: k'). t s -> t' s' -> a) -> PL t ss -> PL t' ss' -> [a]
- zip3ToList :: (forall (s1 :: k1) (s2 :: k2) (s3 :: k3). t1 s1 -> t2 s2 -> t3 s3 -> a) -> PL t1 ss1 -> PL t2 ss2 -> PL t3 ss3 -> [a]
- zip4ToList :: (forall (s1 :: k1) (s2 :: k2) (s3 :: k3) (s4 :: k4). t1 s1 -> t2 s2 -> t3 s3 -> t4 s4 -> a) -> PL t1 ss1 -> PL t2 ss2 -> PL t3 ss3 -> PL t4 ss4 -> [a]
- class ToListWithC c ss where
- toListWithC :: (forall s. c s => t s -> a) -> PL t ss -> [a]
- class ToListWithC2 c sss where
- toListWithC2 :: (forall s. c s => t s -> a) -> PL2 t sss -> [[a]]
- class ZipListWithC c ss where
- zipListWithC :: (forall s. c s => t s -> t' s -> a) -> PL t ss -> PL t' ss -> [a]
- class ZipListWithC2 c sss where
- zipListWithC2 :: (forall s. c s => t s -> t' s -> a) -> PL2 t sss -> PL2 t' sss -> [[a]]
- class ZipListWithC3 c ssss where
- zipListWithC3 :: (forall s. c s => t s -> t' s -> a) -> PL3 t ssss -> PL3 t' ssss -> [[[a]]]
- class ToListWithCM c ss where
- toListWithCM :: Applicative m => (forall s. c s => t s -> m a) -> PL t ss -> m [a]
- class ToListWithCM' c (t' :: k -> k') (ss :: [k]) where
- toListWithCM' :: Applicative m => (forall (s :: k). c (t' s) => t s -> m a) -> PL t ss -> m [a]
- class ToListWithCCpsM c ns where
- toListWithCCpsM :: (forall s. c s => t s -> (a -> m b) -> m b) -> PL t ns -> ([a] -> m b) -> m b
- class ToListWithCCpsM' c (t' :: k -> k') (ns :: [k]) where
- toListWithCCpsM' :: (forall (s :: k). c (t' s) => t s -> (a -> m b) -> m b) -> PL t ns -> ([a] -> m b) -> m b
- withListWithCCpsM' :: forall k c t' ns t m a b. ToListWithCCpsM' c t' ns => PL t ns -> (forall (s :: k). c (t' s) => t s -> (a -> m b) -> m b) -> ([a] -> m b) -> m b
- class HomoList (s :: k) ss where
- homoListFromList :: [t s] -> PL t ss
- homoListToList :: PL t ss -> [t s]
- class HomoListN (n :: Num k) where
- type Replicate n (s :: k') :: [k']
- homoListNFromList :: [t s] -> PL t (Replicate n s)
- mapHomoListNM :: Monad m => (t a -> m (u b)) -> PL t (Replicate n a) -> m (PL u (Replicate n b))
- mapHomoListNMWithI :: Monad m => Int -> (Int -> t a -> m (u b)) -> PL t (Replicate n a) -> m (PL u (Replicate n b))
- zipWithHomoListNM :: Monad m => (t a -> u b -> m (v c)) -> PL t (Replicate n a) -> PL u (Replicate n b) -> m (PL v (Replicate n c))
- zipWithHomoListNM_ :: Monad m => (t a -> u b -> m c) -> PL t (Replicate n a) -> PL u (Replicate n b) -> m ()
- type Num a = [a]
- tnum :: [a] -> (forall (n :: Num ()). HomoListN n => Proxy n -> b) -> b
- class TypeIndex (obj :: k) objs where
- index :: Integral i => PL t ss -> i -> (forall s. t s -> a) -> a
- homoListIndex :: forall s {t} {ss} {i}. (HomoList s ss, Integral i) => PL t ss -> i -> t s
- map :: (forall s. t s -> t' s) -> PL t ss -> PL t' ss
- mapM :: Applicative m => (forall s. t s -> m (t' s)) -> PL t ss -> m (PL t' ss)
- mapM_ :: Applicative m => (forall s. t s -> m a) -> PL t ss -> m ()
- class MapM' (f :: k -> k') ss where
- class Rep n where
- class RepM n where
- replicate :: Int -> (forall a. (forall s. t s -> a) -> a) -> (forall ss. PL t ss -> b) -> b
- replicateM :: Int -> (forall a. (forall s. t s -> m a) -> m a) -> (forall ss. PL t ss -> m b) -> m b
- replicateMWithI :: Int -> (forall a. Int -> (forall s. t s -> m a) -> m a) -> (forall ss. PL t ss -> m b) -> m b
Hetero List
Constructors
Id a |
Lengthed List
Hetero Parameter List
data PL (t :: k -> Type) (ss :: [k]) where Source #
Instances
(Show (t s), Show (PL t ss)) => Show (PL t (s ': ss)) Source # | |
Show (PL t ('[] :: [k])) Source # | |
(Default (t s), Default (PL t ss)) => Default (PL t (s ': ss)) Source # | |
Defined in Data.HeteroParList | |
Default (PL t ('[] :: [k])) Source # | |
Defined in Data.HeteroParList | |
(Eq (t s), Eq (PL t ss)) => Eq (PL t (s ': ss)) Source # | |
Eq (PL t ('[] :: [k])) Source # | |
pattern Singleton2 :: t s -> PL2 t '['[s]] Source #
pattern Singleton3 :: t s -> PL3 t '['['[s]]] Source #
pattern Singleton4 :: t s -> PL4 t '['['['[s]]]] Source #
From/To List
Hetero List
fromList
class FromList (ss :: [k]) where Source #
Instances
FromList ('[] :: [k]) Source # | |
Defined in Data.HeteroParList | |
FromList ss => FromList (s ': ss :: [k]) Source # | |
Defined in Data.HeteroParList |
toList
toListM :: Applicative m => (forall (s :: k). t s -> m a) -> PL t ss -> m [a] Source #
toListM2 :: Applicative m => (forall (s :: k). t s -> m a) -> PL2 t sss -> m [[a]] Source #
toListM3 :: Applicative m => (forall (s :: k). t s -> m a) -> PL3 t sss -> m [[[a]]] Source #
toListM_ :: Applicative m => (forall (s :: k). t s -> m a) -> PL t ss -> m () Source #
toListM2_ :: Applicative m => (forall (s :: k). t s -> m a) -> PL2 t ss -> m () Source #
toListM3_ :: Applicative m => (forall (s :: k). t s -> m a) -> PL3 t ss -> m () Source #
class ToListT2 k1 k2 (ss :: [(k1, k2)]) where Source #
Instances
ToListT2 k1 k2 ('[] :: [(k1, k2)]) Source # | |
Defined in Data.HeteroParList | |
ToListT2 k1 k2 ss => ToListT2 k1 k2 ('(s1, s2) ': ss :: [(k1, k2)]) Source # | |
Defined in Data.HeteroParList |
class ToListT3 k1 k2 k3 (ss :: [(k1, k2, k3)]) where Source #
Methods
toListT3 :: (forall (s1 :: k1) (s2 :: k2) (s3 :: k3). t '(s1, s2, s3) -> a) -> PL t ss -> [a] Source #
Instances
ToListT3 k1 k2 k3 ('[] :: [(k1, k2, k3)]) Source # | |
Defined in Data.HeteroParList | |
ToListT3 k1 k2 k3 ss => ToListT3 k1 k2 k3 ('(s1, s2, s3) ': ss :: [(k1, k2, k3)]) Source # | |
Defined in Data.HeteroParList |
zipToList
zipToList :: (forall (s :: k) (s' :: k'). t s -> t' s' -> a) -> PL t ss -> PL t' ss' -> [a] Source #
zip3ToList :: (forall (s1 :: k1) (s2 :: k2) (s3 :: k3). t1 s1 -> t2 s2 -> t3 s3 -> a) -> PL t1 ss1 -> PL t2 ss2 -> PL t3 ss3 -> [a] Source #
zip4ToList :: (forall (s1 :: k1) (s2 :: k2) (s3 :: k3) (s4 :: k4). t1 s1 -> t2 s2 -> t3 s3 -> t4 s4 -> a) -> PL t1 ss1 -> PL t2 ss2 -> PL t3 ss3 -> PL t4 ss4 -> [a] Source #
with constraint
class ToListWithC c ss where Source #
Methods
toListWithC :: (forall s. c s => t s -> a) -> PL t ss -> [a] Source #
Instances
ToListWithC (c :: k -> Constraint) ('[] :: [k]) Source # | |
Defined in Data.HeteroParList Methods toListWithC :: (forall (s :: k0). c s => t s -> a) -> PL t '[] -> [a] Source # | |
(c s, ToListWithC c ss) => ToListWithC (c :: a -> Constraint) (s ': ss :: [a]) Source # | |
Defined in Data.HeteroParList Methods toListWithC :: (forall (s0 :: k). c s0 => t s0 -> a0) -> PL t (s ': ss) -> [a0] Source # |
class ToListWithC2 c sss where Source #
Methods
toListWithC2 :: (forall s. c s => t s -> a) -> PL2 t sss -> [[a]] Source #
Instances
ToListWithC2 (c :: k -> Constraint) ('[] :: [[k]]) Source # | |
Defined in Data.HeteroParList Methods toListWithC2 :: (forall (s :: k0). c s => t s -> a) -> PL2 t '[] -> [[a]] Source # | |
(ToListWithC c ss, ToListWithC2 c sss) => ToListWithC2 (c :: k -> Constraint) (ss ': sss :: [[k]]) Source # | |
Defined in Data.HeteroParList Methods toListWithC2 :: (forall (s :: k0). c s => t s -> a) -> PL2 t (ss ': sss) -> [[a]] Source # |
class ZipListWithC c ss where Source #
Methods
zipListWithC :: (forall s. c s => t s -> t' s -> a) -> PL t ss -> PL t' ss -> [a] Source #
Instances
ZipListWithC (c :: k -> Constraint) ('[] :: [k]) Source # | |
Defined in Data.HeteroParList Methods zipListWithC :: (forall (s :: k0). c s => t s -> t' s -> a) -> PL t '[] -> PL t' '[] -> [a] Source # | |
(c s, ZipListWithC c ss) => ZipListWithC (c :: a -> Constraint) (s ': ss :: [a]) Source # | |
Defined in Data.HeteroParList Methods zipListWithC :: (forall (s0 :: k). c s0 => t s0 -> t' s0 -> a0) -> PL t (s ': ss) -> PL t' (s ': ss) -> [a0] Source # |
class ZipListWithC2 c sss where Source #
Methods
zipListWithC2 :: (forall s. c s => t s -> t' s -> a) -> PL2 t sss -> PL2 t' sss -> [[a]] Source #
Instances
ZipListWithC2 (c :: k -> Constraint) ('[] :: [[k]]) Source # | |
Defined in Data.HeteroParList Methods zipListWithC2 :: (forall (s :: k0). c s => t s -> t' s -> a) -> PL2 t '[] -> PL2 t' '[] -> [[a]] Source # | |
(ZipListWithC c ss, ZipListWithC2 c sss) => ZipListWithC2 (c :: k -> Constraint) (ss ': sss :: [[k]]) Source # | |
Defined in Data.HeteroParList Methods zipListWithC2 :: (forall (s :: k0). c s => t s -> t' s -> a) -> PL2 t (ss ': sss) -> PL2 t' (ss ': sss) -> [[a]] Source # |
class ZipListWithC3 c ssss where Source #
Methods
zipListWithC3 :: (forall s. c s => t s -> t' s -> a) -> PL3 t ssss -> PL3 t' ssss -> [[[a]]] Source #
Instances
ZipListWithC3 (c :: k -> Constraint) ('[] :: [[[k]]]) Source # | |
Defined in Data.HeteroParList Methods zipListWithC3 :: (forall (s :: k0). c s => t s -> t' s -> a) -> PL3 t '[] -> PL3 t' '[] -> [[[a]]] Source # | |
(ZipListWithC2 c sss, ZipListWithC3 c ssss) => ZipListWithC3 (c :: k -> Constraint) (sss ': ssss :: [[[k]]]) Source # | |
Defined in Data.HeteroParList Methods zipListWithC3 :: (forall (s :: k0). c s => t s -> t' s -> a) -> PL3 t (sss ': ssss) -> PL3 t' (sss ': ssss) -> [[[a]]] Source # |
class ToListWithCM c ss where Source #
Methods
toListWithCM :: Applicative m => (forall s. c s => t s -> m a) -> PL t ss -> m [a] Source #
Instances
ToListWithCM (c :: k -> Constraint) ('[] :: [k]) Source # | |
Defined in Data.HeteroParList Methods toListWithCM :: Applicative m => (forall (s :: k0). c s => t s -> m a) -> PL t '[] -> m [a] Source # | |
(c s, ToListWithCM c ss) => ToListWithCM (c :: a -> Constraint) (s ': ss :: [a]) Source # | |
Defined in Data.HeteroParList Methods toListWithCM :: Applicative m => (forall (s0 :: k). c s0 => t s0 -> m a0) -> PL t (s ': ss) -> m [a0] Source # |
class ToListWithCM' c (t' :: k -> k') (ss :: [k]) where Source #
Methods
toListWithCM' :: Applicative m => (forall (s :: k). c (t' s) => t s -> m a) -> PL t ss -> m [a] Source #
Instances
ToListWithCM' (c :: k' -> Constraint) (t' :: k -> k') ('[] :: [k]) Source # | |
Defined in Data.HeteroParList Methods toListWithCM' :: Applicative m => (forall (s :: k0). c (t' s) => t s -> m a) -> PL t '[] -> m [a] Source # | |
(c (t' s), ToListWithCM' c t' ss) => ToListWithCM' (c :: k' -> Constraint) (t' :: a -> k') (s ': ss :: [a]) Source # | |
Defined in Data.HeteroParList Methods toListWithCM' :: Applicative m => (forall (s0 :: k). c (t' s0) => t s0 -> m a0) -> PL t (s ': ss) -> m [a0] Source # |
class ToListWithCCpsM c ns where Source #
Methods
toListWithCCpsM :: (forall s. c s => t s -> (a -> m b) -> m b) -> PL t ns -> ([a] -> m b) -> m b Source #
Instances
ToListWithCCpsM (c :: k -> Constraint) ('[] :: [k]) Source # | |
Defined in Data.HeteroParList Methods toListWithCCpsM :: forall {k1} t a m (b :: k1). (forall (s :: k0). c s => t s -> (a -> m b) -> m b) -> PL t '[] -> ([a] -> m b) -> m b Source # | |
(c n, ToListWithCCpsM c ns) => ToListWithCCpsM (c :: a -> Constraint) (n ': ns :: [a]) Source # | |
Defined in Data.HeteroParList Methods toListWithCCpsM :: forall {k1} t a0 m (b :: k1). (forall (s :: k). c s => t s -> (a0 -> m b) -> m b) -> PL t (n ': ns) -> ([a0] -> m b) -> m b Source # |
class ToListWithCCpsM' c (t' :: k -> k') (ns :: [k]) where Source #
Methods
toListWithCCpsM' :: (forall (s :: k). c (t' s) => t s -> (a -> m b) -> m b) -> PL t ns -> ([a] -> m b) -> m b Source #
Instances
ToListWithCCpsM' (c :: k' -> Constraint) (t' :: k -> k') ('[] :: [k]) Source # | |
Defined in Data.HeteroParList Methods toListWithCCpsM' :: forall {k1} t a m (b :: k1). (forall (s :: k0). c (t' s) => t s -> (a -> m b) -> m b) -> PL t '[] -> ([a] -> m b) -> m b Source # | |
(c (t' n), ToListWithCCpsM' c t' ns) => ToListWithCCpsM' (c :: k' -> Constraint) (t' :: a -> k') (n ': ns :: [a]) Source # | |
Defined in Data.HeteroParList Methods toListWithCCpsM' :: forall {k1} t a0 m (b :: k1). (forall (s :: k). c (t' s) => t s -> (a0 -> m b) -> m b) -> PL t (n ': ns) -> ([a0] -> m b) -> m b Source # |
withListWithCCpsM' :: forall k c t' ns t m a b. ToListWithCCpsM' c t' ns => PL t ns -> (forall (s :: k). c (t' s) => t s -> (a -> m b) -> m b) -> ([a] -> m b) -> m b Source #
Homo List
Homo List
class HomoList (s :: k) ss where Source #
Instances
HomoList (s :: k) ('[] :: [k]) Source # | |
Defined in Data.HeteroParList | |
HomoList s ss => HomoList (s :: a) (s ': ss :: [a]) Source # | |
Defined in Data.HeteroParList Methods homoListFromList :: [t s] -> PL t (s ': ss) Source # homoListToList :: PL t (s ': ss) -> [t s] Source # |
Homo List With Num
class HomoListN (n :: Num k) where Source #
Methods
homoListNFromList :: [t s] -> PL t (Replicate n s) Source #
mapHomoListNM :: Monad m => (t a -> m (u b)) -> PL t (Replicate n a) -> m (PL u (Replicate n b)) Source #
mapHomoListNMWithI :: Monad m => Int -> (Int -> t a -> m (u b)) -> PL t (Replicate n a) -> m (PL u (Replicate n b)) Source #
zipWithHomoListNM :: Monad m => (t a -> u b -> m (v c)) -> PL t (Replicate n a) -> PL u (Replicate n b) -> m (PL v (Replicate n c)) Source #
zipWithHomoListNM_ :: Monad m => (t a -> u b -> m c) -> PL t (Replicate n a) -> PL u (Replicate n b) -> m () Source #
Instances
HomoListN ('[] :: [k]) Source # | |
Defined in Data.HeteroParList Methods homoListNFromList :: forall {k'} t (s :: k'). [t s] -> PL t (Replicate '[] s) Source # mapHomoListNM :: forall {k'1} {k'2} m t (a :: k'1) u (b :: k'2). Monad m => (t a -> m (u b)) -> PL t (Replicate '[] a) -> m (PL u (Replicate '[] b)) Source # mapHomoListNMWithI :: forall {k'1} {k'2} m t (a :: k'1) u (b :: k'2). Monad m => Int -> (Int -> t a -> m (u b)) -> PL t (Replicate '[] a) -> m (PL u (Replicate '[] b)) Source # zipWithHomoListNM :: forall {k'1} {k'2} {k'3} m t (a :: k'1) u (b :: k'2) v (c :: k'3). Monad m => (t a -> u b -> m (v c)) -> PL t (Replicate '[] a) -> PL u (Replicate '[] b) -> m (PL v (Replicate '[] c)) Source # zipWithHomoListNM_ :: forall {k'1} {k'2} m t (a :: k'1) u (b :: k'2) c. Monad m => (t a -> u b -> m c) -> PL t (Replicate '[] a) -> PL u (Replicate '[] b) -> m () Source # | |
HomoListN ds => HomoListN (d ': ds :: [k]) Source # | |
Defined in Data.HeteroParList Methods homoListNFromList :: forall {k'} t (s :: k'). [t s] -> PL t (Replicate (d ': ds) s) Source # mapHomoListNM :: forall {k'1} {k'2} m t (a :: k'1) u (b :: k'2). Monad m => (t a -> m (u b)) -> PL t (Replicate (d ': ds) a) -> m (PL u (Replicate (d ': ds) b)) Source # mapHomoListNMWithI :: forall {k'1} {k'2} m t (a :: k'1) u (b :: k'2). Monad m => Int -> (Int -> t a -> m (u b)) -> PL t (Replicate (d ': ds) a) -> m (PL u (Replicate (d ': ds) b)) Source # zipWithHomoListNM :: forall {k'1} {k'2} {k'3} m t (a :: k'1) u (b :: k'2) v (c :: k'3). Monad m => (t a -> u b -> m (v c)) -> PL t (Replicate (d ': ds) a) -> PL u (Replicate (d ': ds) b) -> m (PL v (Replicate (d ': ds) c)) Source # zipWithHomoListNM_ :: forall {k'1} {k'2} m t (a :: k'1) u (b :: k'2) c. Monad m => (t a -> u b -> m c) -> PL t (Replicate (d ': ds) a) -> PL u (Replicate (d ': ds) b) -> m () Source # |
Index
Map and ReplicateM
mapM_ :: Applicative m => (forall s. t s -> m a) -> PL t ss -> m () Source #
class MapM' (f :: k -> k') ss where Source #
Methods
mapM' :: Applicative m => (forall s. t s -> m (t' (f s))) -> PL t ss -> m (PL t' (Ss' f ss)) Source #
Methods
repM :: (forall a. (forall s. t s -> m a) -> m a) -> (forall ss. PL t ss -> m b) -> m b Source #
Instances
RepM (n - 1) => RepM (n :: Natural) Source # | |
Defined in Data.HeteroParList | |
RepM 0 Source # | |
Defined in Data.HeteroParList | |
RepM ('[] :: [k]) Source # | |
Defined in Data.HeteroParList | |
RepM n => RepM ('() ': n :: [()]) Source # | |
Defined in Data.HeteroParList |
replicate :: Int -> (forall a. (forall s. t s -> a) -> a) -> (forall ss. PL t ss -> b) -> b Source #
replicateM :: Int -> (forall a. (forall s. t s -> m a) -> m a) -> (forall ss. PL t ss -> m b) -> m b Source #