generics-mrsop-2.3.0: Generic Programming with Mutually Recursive Sums of Products.

Safe HaskellSafe
LanguageHaskell2010

Generics.MRSOP.Util

Contents

Description

Useful utilities we need accross multiple modules.

Synopsis

Utility Functions and Types

(&&&) :: Arrow a => a b c -> a b c' -> a b (c, c') infixr 3 #

Fanout: send the input to both argument arrows and combine their output.

The default definition may be overridden with a more efficient version if desired.

(***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c') infixr 3 #

Split the input between the two argument arrows and combine their output. Note that this is in general not a functor.

The default definition may be overridden with a more efficient version if desired.

type (:->) f g = forall n. f n -> g n Source #

Natural transformations

(<.>) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c infixr 8 Source #

Kleisli Composition

Poly-kind indexed product functionality

data Product (f :: k -> Type) (g :: k -> Type) (a :: k) :: forall k. (k -> Type) -> (k -> Type) -> k -> Type #

Lifted product of functors.

Constructors

Pair (f a) (g a) 
Instances
Generic1 (Product f g :: k -> Type) 
Instance details

Defined in Data.Functor.Product

Associated Types

type Rep1 (Product f g) :: k -> Type #

Methods

from1 :: Product f g a -> Rep1 (Product f g) a #

to1 :: Rep1 (Product f g) a -> Product f g a #

(ShowHO f, ShowHO g) => ShowHO (Product f g :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

showHO :: Product f g k -> String Source #

showsPrecHO :: Int -> Product f g k -> ShowS Source #

(EqHO f, EqHO g) => EqHO (Product f g :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

eqHO :: Product f g k -> Product f g k -> Bool Source #

(Monad f, Monad g) => Monad (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

(>>=) :: Product f g a -> (a -> Product f g b) -> Product f g b #

(>>) :: Product f g a -> Product f g b -> Product f g b #

return :: a -> Product f g a #

fail :: String -> Product f g a #

(Functor f, Functor g) => Functor (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

fmap :: (a -> b) -> Product f g a -> Product f g b #

(<$) :: a -> Product f g b -> Product f g a #

(MonadFix f, MonadFix g) => MonadFix (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

mfix :: (a -> Product f g a) -> Product f g a #

(Applicative f, Applicative g) => Applicative (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

pure :: a -> Product f g a #

(<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b #

liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c #

(*>) :: Product f g a -> Product f g b -> Product f g b #

(<*) :: Product f g a -> Product f g b -> Product f g a #

(Foldable f, Foldable g) => Foldable (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

fold :: Monoid m => Product f g m -> m #

foldMap :: Monoid m => (a -> m) -> Product f g a -> m #

foldr :: (a -> b -> b) -> b -> Product f g a -> b #

foldr' :: (a -> b -> b) -> b -> Product f g a -> b #

foldl :: (b -> a -> b) -> b -> Product f g a -> b #

foldl' :: (b -> a -> b) -> b -> Product f g a -> b #

foldr1 :: (a -> a -> a) -> Product f g a -> a #

foldl1 :: (a -> a -> a) -> Product f g a -> a #

toList :: Product f g a -> [a] #

null :: Product f g a -> Bool #

length :: Product f g a -> Int #

elem :: Eq a => a -> Product f g a -> Bool #

maximum :: Ord a => Product f g a -> a #

minimum :: Ord a => Product f g a -> a #

sum :: Num a => Product f g a -> a #

product :: Num a => Product f g a -> a #

(Traversable f, Traversable g) => Traversable (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Product f g a -> f0 (Product f g b) #

sequenceA :: Applicative f0 => Product f g (f0 a) -> f0 (Product f g a) #

mapM :: Monad m => (a -> m b) -> Product f g a -> m (Product f g b) #

sequence :: Monad m => Product f g (m a) -> m (Product f g a) #

(Eq1 f, Eq1 g) => Eq1 (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

liftEq :: (a -> b -> Bool) -> Product f g a -> Product f g b -> Bool #

(Ord1 f, Ord1 g) => Ord1 (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

liftCompare :: (a -> b -> Ordering) -> Product f g a -> Product f g b -> Ordering #

(Read1 f, Read1 g) => Read1 (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Product f g a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Product f g a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Product f g a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Product f g a] #

(Show1 f, Show1 g) => Show1 (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Product f g a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Product f g a] -> ShowS #

(MonadZip f, MonadZip g) => MonadZip (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

mzip :: Product f g a -> Product f g b -> Product f g (a, b) #

mzipWith :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c #

munzip :: Product f g (a, b) -> (Product f g a, Product f g b) #

(Alternative f, Alternative g) => Alternative (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

empty :: Product f g a #

(<|>) :: Product f g a -> Product f g a -> Product f g a #

some :: Product f g a -> Product f g [a] #

many :: Product f g a -> Product f g [a] #

(MonadPlus f, MonadPlus g) => MonadPlus (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

mzero :: Product f g a #

mplus :: Product f g a -> Product f g a -> Product f g a #

(Eq1 f, Eq1 g, Eq a) => Eq (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

(==) :: Product f g a -> Product f g a -> Bool #

(/=) :: Product f g a -> Product f g a -> Bool #

(Typeable a, Typeable f, Typeable g, Typeable k, Data (f a), Data (g a)) => Data (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> Product f g a -> c (Product f g a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Product f g a) #

toConstr :: Product f g a -> Constr #

dataTypeOf :: Product f g a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Product f g a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Product f g a)) #

gmapT :: (forall b. Data b => b -> b) -> Product f g a -> Product f g a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Product f g a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Product f g a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Product f g a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Product f g a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Product f g a -> m (Product f g a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Product f g a -> m (Product f g a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Product f g a -> m (Product f g a) #

(Ord1 f, Ord1 g, Ord a) => Ord (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

compare :: Product f g a -> Product f g a -> Ordering #

(<) :: Product f g a -> Product f g a -> Bool #

(<=) :: Product f g a -> Product f g a -> Bool #

(>) :: Product f g a -> Product f g a -> Bool #

(>=) :: Product f g a -> Product f g a -> Bool #

max :: Product f g a -> Product f g a -> Product f g a #

min :: Product f g a -> Product f g a -> Product f g a #

(Read1 f, Read1 g, Read a) => Read (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

readsPrec :: Int -> ReadS (Product f g a) #

readList :: ReadS [Product f g a] #

readPrec :: ReadPrec (Product f g a) #

readListPrec :: ReadPrec [Product f g a] #

(Show1 f, Show1 g, Show a) => Show (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

showsPrec :: Int -> Product f g a -> ShowS #

show :: Product f g a -> String #

showList :: [Product f g a] -> ShowS #

Generic (Product f g a) 
Instance details

Defined in Data.Functor.Product

Associated Types

type Rep (Product f g a) :: Type -> Type #

Methods

from :: Product f g a -> Rep (Product f g a) x #

to :: Rep (Product f g a) x -> Product f g a #

type Rep1 (Product f g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

type Rep (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

type (:*:) = Product Source #

Convenient type synonym for Product

pattern (:*:) :: f a -> g a -> Product f g a Source #

Convnient pattern synonym for Pair

type Delta f = Product f f Source #

Diagonal indexed functor

curry' :: (Product f g x -> a) -> f x -> g x -> a Source #

Lifted curry

uncurry' :: (f x -> g x -> a) -> Product f g x -> a Source #

Lifted uncurry

delta :: f :-> Delta f Source #

Duplicates its argument

Poly-kind indexed sums

data Sum (f :: k -> Type) (g :: k -> Type) (a :: k) :: forall k. (k -> Type) -> (k -> Type) -> k -> Type #

Lifted sum of functors.

Constructors

InL (f a) 
InR (g a) 
Instances
Generic1 (Sum f g :: k -> Type) 
Instance details

Defined in Data.Functor.Sum

Associated Types

type Rep1 (Sum f g) :: k -> Type #

Methods

from1 :: Sum f g a -> Rep1 (Sum f g) a #

to1 :: Rep1 (Sum f g) a -> Sum f g a #

(ShowHO f, ShowHO g) => ShowHO (Sum f g :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

showHO :: Sum f g k -> String Source #

showsPrecHO :: Int -> Sum f g k -> ShowS Source #

(EqHO f, EqHO g) => EqHO (Sum f g :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

eqHO :: Sum f g k -> Sum f g k -> Bool Source #

(Functor f, Functor g) => Functor (Sum f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

fmap :: (a -> b) -> Sum f g a -> Sum f g b #

(<$) :: a -> Sum f g b -> Sum f g a #

(Foldable f, Foldable g) => Foldable (Sum f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

fold :: Monoid m => Sum f g m -> m #

foldMap :: Monoid m => (a -> m) -> Sum f g a -> m #

foldr :: (a -> b -> b) -> b -> Sum f g a -> b #

foldr' :: (a -> b -> b) -> b -> Sum f g a -> b #

foldl :: (b -> a -> b) -> b -> Sum f g a -> b #

foldl' :: (b -> a -> b) -> b -> Sum f g a -> b #

foldr1 :: (a -> a -> a) -> Sum f g a -> a #

foldl1 :: (a -> a -> a) -> Sum f g a -> a #

toList :: Sum f g a -> [a] #

null :: Sum f g a -> Bool #

length :: Sum f g a -> Int #

elem :: Eq a => a -> Sum f g a -> Bool #

maximum :: Ord a => Sum f g a -> a #

minimum :: Ord a => Sum f g a -> a #

sum :: Num a => Sum f g a -> a #

product :: Num a => Sum f g a -> a #

(Traversable f, Traversable g) => Traversable (Sum f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Sum f g a -> f0 (Sum f g b) #

sequenceA :: Applicative f0 => Sum f g (f0 a) -> f0 (Sum f g a) #

mapM :: Monad m => (a -> m b) -> Sum f g a -> m (Sum f g b) #

sequence :: Monad m => Sum f g (m a) -> m (Sum f g a) #

(Eq1 f, Eq1 g) => Eq1 (Sum f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

liftEq :: (a -> b -> Bool) -> Sum f g a -> Sum f g b -> Bool #

(Ord1 f, Ord1 g) => Ord1 (Sum f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

liftCompare :: (a -> b -> Ordering) -> Sum f g a -> Sum f g b -> Ordering #

(Read1 f, Read1 g) => Read1 (Sum f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Sum f g a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Sum f g a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Sum f g a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Sum f g a] #

(Show1 f, Show1 g) => Show1 (Sum f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Sum f g a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Sum f g a] -> ShowS #

(Eq1 f, Eq1 g, Eq a) => Eq (Sum f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

(==) :: Sum f g a -> Sum f g a -> Bool #

(/=) :: Sum f g a -> Sum f g a -> Bool #

(Typeable a, Typeable f, Typeable g, Typeable k, Data (f a), Data (g a)) => Data (Sum f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> Sum f g a -> c (Sum f g a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Sum f g a) #

toConstr :: Sum f g a -> Constr #

dataTypeOf :: Sum f g a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Sum f g a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Sum f g a)) #

gmapT :: (forall b. Data b => b -> b) -> Sum f g a -> Sum f g a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sum f g a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sum f g a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Sum f g a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Sum f g a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sum f g a -> m (Sum f g a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum f g a -> m (Sum f g a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum f g a -> m (Sum f g a) #

(Ord1 f, Ord1 g, Ord a) => Ord (Sum f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

compare :: Sum f g a -> Sum f g a -> Ordering #

(<) :: Sum f g a -> Sum f g a -> Bool #

(<=) :: Sum f g a -> Sum f g a -> Bool #

(>) :: Sum f g a -> Sum f g a -> Bool #

(>=) :: Sum f g a -> Sum f g a -> Bool #

max :: Sum f g a -> Sum f g a -> Sum f g a #

min :: Sum f g a -> Sum f g a -> Sum f g a #

(Read1 f, Read1 g, Read a) => Read (Sum f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

readsPrec :: Int -> ReadS (Sum f g a) #

readList :: ReadS [Sum f g a] #

readPrec :: ReadPrec (Sum f g a) #

readListPrec :: ReadPrec [Sum f g a] #

(Show1 f, Show1 g, Show a) => Show (Sum f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Methods

showsPrec :: Int -> Sum f g a -> ShowS #

show :: Sum f g a -> String #

showList :: [Sum f g a] -> ShowS #

Generic (Sum f g a) 
Instance details

Defined in Data.Functor.Sum

Associated Types

type Rep (Sum f g a) :: Type -> Type #

Methods

from :: Sum f g a -> Rep (Sum f g a) x #

to :: Rep (Sum f g a) x -> Sum f g a #

type Rep1 (Sum f g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

type Rep (Sum f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

either' :: (f :-> r) -> (g :-> r) -> Sum f g :-> r Source #

Higher-order sum eliminator

either'' :: (forall x. f x -> a) -> (forall y. g y -> a) -> Sum f g r -> a Source #

Just like either', but the result type is of kind Star

Type-level Naturals

data Nat Source #

Type-level Peano Naturals

Constructors

S Nat 
Z 
Instances
Eq Nat Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

(==) :: Nat -> Nat -> Bool #

(/=) :: Nat -> Nat -> Bool #

Show Nat Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

showsPrec :: Int -> Nat -> ShowS #

show :: Nat -> String #

showList :: [Nat] -> ShowS #

TestEquality SNat Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

testEquality :: SNat a -> SNat b -> Maybe (a :~: b) #

TestEquality (Constr codes :: Nat -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Base.Universe

Methods

testEquality :: Constr codes a -> Constr codes b -> Maybe (a :~: b) #

ShowHO ki => ShowHO (Fix ki codes :: Nat -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Base.Universe

Methods

showHO :: Fix ki codes k -> String Source #

showsPrecHO :: Int -> Fix ki codes k -> ShowS Source #

EqHO ki => EqHO (Fix ki codes :: Nat -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Base.Universe

Methods

eqHO :: Fix ki codes k -> Fix ki codes k -> Bool Source #

proxyUnsuc :: Proxy (S n) -> Proxy n Source #

Typelevel predecessor operation

data SNat :: Nat -> * where Source #

Singleton Term-level natural

Constructors

SZ :: SNat Z 
SS :: SNat n -> SNat (S n) 
Instances
TestEquality SNat Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

testEquality :: SNat a -> SNat b -> Maybe (a :~: b) #

snat2int :: SNat n -> Integer Source #

Returns n as a first class integer.

class IsNat (n :: Nat) where Source #

And their conversion to term-level integers.

Methods

getSNat :: Proxy n -> SNat n Source #

Instances
IsNat Z Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

getSNat :: Proxy Z -> SNat Z Source #

IsNat n => IsNat (S n) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

getSNat :: Proxy (S n) -> SNat (S n) Source #

getSNat' :: forall (n :: Nat). IsNat n => SNat n Source #

Type-level Lists

data ListPrf :: [k] -> * where Source #

An inhabitant of ListPrf ls is *not* a singleton! It only proves that ls is, in fact, a type level list. This is useful since it enables us to pattern match on type-level lists whenever we see fit.

Constructors

LP_Nil :: ListPrf '[] 
LP_Cons :: ListPrf l -> ListPrf (x ': l) 

class IsList (xs :: [k]) where Source #

The IsList class allows us to construct ListPrfs in a straight forward fashion.

Methods

listPrf :: ListPrf xs Source #

Instances
IsList ([] :: [k]) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

listPrf :: ListPrf [] Source #

IsList xs => IsList (x ': xs :: [k]) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

listPrf :: ListPrf (x ': xs) Source #

type L1 xs = IsList xs Source #

Convenient constraint synonyms

type L2 xs ys = (IsList xs, IsList ys) Source #

type L3 xs ys zs = (IsList xs, IsList ys, IsList zs) Source #

type L4 xs ys zs as = (IsList xs, IsList ys, IsList zs, IsList as) Source #

type family (txs :: [k]) :++: (tys :: [k]) :: [k] where ... Source #

Appending type-level lists

Equations

'[] :++: tys = tys 
(tx ': txs) :++: tys = tx ': (txs :++: tys) 

appendIsListLemma :: ListPrf xs -> ListPrf ys -> ListPrf (xs :++: ys) Source #

Concatenation of lists is also a list.

Type-level List Lookup

type family Lkup (n :: Nat) (ks :: [k]) :: k where ... Source #

Type-level list lookup

Equations

Lkup Z (k ': ks) = k 
Lkup (S n) (k ': ks) = Lkup n ks 
Lkup _ '[] = TypeError (Text "Lkup index too big") 

type family Idx (ty :: k) (xs :: [k]) :: Nat where ... Source #

Type-level list index

Equations

Idx x (x ': ys) = Z 
Idx x (y ': ys) = S (Idx x ys) 
Idx x '[] = TypeError (Text "Element not found") 

data El :: [*] -> Nat -> * where Source #

Also list lookup, but for kind * only.

Constructors

El 

Fields

getElSNat :: forall ix ls. El ls ix -> SNat ix Source #

Convenient way to cast an El index to term-level.

into :: forall fam ty ix. (ix ~ Idx ty fam, Lkup ix fam ~ ty, IsNat ix) => ty -> El fam ix Source #

Smart constructor into El

Higher-order Eq and Show

class EqHO (f :: ki -> *) where Source #

Higher order , poly kinded, version of Eq @since 2.3.0

Methods

eqHO :: forall k. f k -> f k -> Bool Source #

Instances
EqHO Singl Source # 
Instance details

Defined in Generics.MRSOP.Opaque

Methods

eqHO :: Singl k -> Singl k -> Bool Source #

Eq a => EqHO (Const a :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

eqHO :: Const a k -> Const a k -> Bool Source #

(EqHO f, EqHO g) => EqHO (Sum f g :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

eqHO :: Sum f g k -> Sum f g k -> Bool Source #

(EqHO f, EqHO g) => EqHO (Product f g :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

eqHO :: Product f g k -> Product f g k -> Bool Source #

EqHO ki => EqHO (Fix ki codes :: Nat -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Base.Universe

Methods

eqHO :: Fix ki codes k -> Fix ki codes k -> Bool Source #

EqHO f => EqHO (NS f :: [k] -> Type) Source #

Since: 2.3.0

Instance details

Defined in Generics.MRSOP.Base.NS

Methods

eqHO :: NS f k0 -> NS f k0 -> Bool Source #

EqHO f => EqHO (NP f :: [k] -> Type) Source #

Since: 2.3.0

Instance details

Defined in Generics.MRSOP.Base.NP

Methods

eqHO :: NP f k0 -> NP f k0 -> Bool Source #

(EqHO phi, EqHO ki) => EqHO (Rep ki phi :: [[Atom kon]] -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Base.Universe

Methods

eqHO :: Rep ki phi k -> Rep ki phi k -> Bool Source #

(EqHO phi, EqHO ki) => EqHO (NA ki phi :: Atom kon -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Base.Universe

Methods

eqHO :: NA ki phi k -> NA ki phi k -> Bool Source #

(EqHO phi, EqHO ki) => EqHO (Holes ki codes phi :: Atom kon -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Holes

Methods

eqHO :: Holes ki codes phi k -> Holes ki codes phi k -> Bool Source #

class ShowHO (f :: ki -> *) where Source #

Higher order, poly kinded, version of Show; We provide the same showsPrec mechanism. The documentation of Text.Show has a good example of the correct usage of showsPrec:

infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a

instance (Show a) => Show (Tree a) where
  showsPrec d (Leaf m) = showParen (d > app_prec) $
       showString "Leaf " . showsPrec (app_prec+1) m
    where app_prec = 10

  showsPrec d (u :^: v) = showParen (d > up_prec) $
       showsPrec (up_prec+1) u .
       showString " :^: "      .
       showsPrec (up_prec+1) v
    where up_prec = 5

Since: 2.3.0

Minimal complete definition

showHO | showsPrecHO

Methods

showHO :: forall k. f k -> String Source #

showsPrecHO :: forall k. Int -> f k -> ShowS Source #

Instances
ShowHO Singl Source # 
Instance details

Defined in Generics.MRSOP.Opaque

Show a => ShowHO (Const a :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

showHO :: Const a k -> String Source #

showsPrecHO :: Int -> Const a k -> ShowS Source #

(ShowHO f, ShowHO g) => ShowHO (Sum f g :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

showHO :: Sum f g k -> String Source #

showsPrecHO :: Int -> Sum f g k -> ShowS Source #

(ShowHO f, ShowHO g) => ShowHO (Product f g :: ki -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Util

Methods

showHO :: Product f g k -> String Source #

showsPrecHO :: Int -> Product f g k -> ShowS Source #

ShowHO ki => ShowHO (Fix ki codes :: Nat -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Base.Universe

Methods

showHO :: Fix ki codes k -> String Source #

showsPrecHO :: Int -> Fix ki codes k -> ShowS Source #

ShowHO f => ShowHO (NS f :: [k] -> Type) Source #

Since: 2.3.0

Instance details

Defined in Generics.MRSOP.Base.NS

Methods

showHO :: NS f k0 -> String Source #

showsPrecHO :: Int -> NS f k0 -> ShowS Source #

ShowHO f => ShowHO (NP f :: [k] -> Type) Source #

Since: 2.3.0

Instance details

Defined in Generics.MRSOP.Base.NP

Methods

showHO :: NP f k0 -> String Source #

showsPrecHO :: Int -> NP f k0 -> ShowS Source #

(ShowHO ki, ShowHO phi) => ShowHO (Rep ki phi :: [[Atom kon]] -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Base.Universe

Methods

showHO :: Rep ki phi k -> String Source #

showsPrecHO :: Int -> Rep ki phi k -> ShowS Source #

(ShowHO phi, ShowHO ki) => ShowHO (NA ki phi :: Atom kon -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Base.Universe

Methods

showHO :: NA ki phi k -> String Source #

showsPrecHO :: Int -> NA ki phi k -> ShowS Source #

(HasDatatypeInfo ki fam codes, ShowHO ki, ShowHO f, ShowHO ann) => ShowHO (HolesAnn ann ki codes f :: Atom kon -> Type) Source # 
Instance details

Defined in Generics.MRSOP.Holes

Methods

showHO :: HolesAnn ann ki codes f k -> String Source #

showsPrecHO :: Int -> HolesAnn ann ki codes f k -> ShowS Source #