hakaru-0.6.0: A probabilistic programming language

CopyrightCopyright (c) 2016 the Hakaru team
LicenseBSD3
Maintainerwren@community.haskell.org
Stabilityexperimental
PortabilityGHC-only
Safe HaskellSafe
LanguageHaskell2010

Language.Hakaru.Types.DataKind

Contents

Description

A data-kind for the universe of Hakaru types.

Synopsis

The core definition of Hakaru types

data Hakaru Source #

The universe/kind of Hakaru types.

Constructors

HNat

The natural numbers; aka, the non-negative integers.

HInt

The integers.

HProb

Non-negative real numbers. Unlike what you might expect, this is not restructed to the [0,1] interval!

HReal

The affinely extended real number line. That is, the real numbers extended with positive and negative infinities.

HMeasure !Hakaru

The measure monad

HArray !Hakaru

The built-in type for uniform arrays.

!Hakaru :-> !Hakaru infixr 0

The type of Hakaru functions.

HData !HakaruCon [[HakaruFun]]

A user-defined polynomial datatype. Each such type is specified by a "tag" (the HakaruCon) which names the type, and a sum-of-product representation of the type itself.

Instances
Category Coercion # 
Instance details

Methods

id :: Coercion a a #

(.) :: Coercion b c -> Coercion a b -> Coercion a c #

JmEq1 HContinuous Source # 
Instance details

Methods

jmEq1 :: HContinuous i -> HContinuous j -> Maybe (TypeEq i j) Source #

JmEq1 HDiscrete Source # 
Instance details

Methods

jmEq1 :: HDiscrete i -> HDiscrete j -> Maybe (TypeEq i j) Source #

JmEq1 HIntegrable Source # 
Instance details

Methods

jmEq1 :: HIntegrable i -> HIntegrable j -> Maybe (TypeEq i j) Source #

JmEq1 HRadical Source # 
Instance details

Methods

jmEq1 :: HRadical i -> HRadical j -> Maybe (TypeEq i j) Source #

JmEq1 HFractional Source # 
Instance details

Methods

jmEq1 :: HFractional i -> HFractional j -> Maybe (TypeEq i j) Source #

JmEq1 HRing Source # 
Instance details

Methods

jmEq1 :: HRing i -> HRing j -> Maybe (TypeEq i j) Source #

JmEq1 HSemiring Source # 
Instance details

Methods

jmEq1 :: HSemiring i -> HSemiring j -> Maybe (TypeEq i j) Source #

JmEq1 NaryOp Source # 
Instance details

Methods

jmEq1 :: NaryOp i -> NaryOp j -> Maybe (TypeEq i j) Source #

JmEq1 Literal Source # 
Instance details

Methods

jmEq1 :: Literal i -> Literal j -> Maybe (TypeEq i j) Source #

Eq1 HContinuous Source # 
Instance details

Methods

eq1 :: HContinuous i -> HContinuous i -> Bool Source #

Eq1 HDiscrete Source # 
Instance details

Methods

eq1 :: HDiscrete i -> HDiscrete i -> Bool Source #

Eq1 HIntegrable Source # 
Instance details

Methods

eq1 :: HIntegrable i -> HIntegrable i -> Bool Source #

Eq1 HRadical Source # 
Instance details

Methods

eq1 :: HRadical i -> HRadical i -> Bool Source #

Eq1 HFractional Source # 
Instance details

Methods

eq1 :: HFractional i -> HFractional i -> Bool Source #

Eq1 HRing Source # 
Instance details

Methods

eq1 :: HRing i -> HRing i -> Bool Source #

Eq1 HSemiring Source # 
Instance details

Methods

eq1 :: HSemiring i -> HSemiring i -> Bool Source #

Eq1 Value Source # 
Instance details

Methods

eq1 :: Value i -> Value i -> Bool Source #

Eq1 NaryOp Source # 
Instance details

Methods

eq1 :: NaryOp i -> NaryOp i -> Bool Source #

Eq1 Literal Source # 
Instance details

Methods

eq1 :: Literal i -> Literal i -> Bool Source #

Show1 Value Source # 
Instance details
Show1 Literal Source # 
Instance details
SingI HNat Source # 
Instance details

Methods

sing :: Sing HNat Source #

SingI HInt Source # 
Instance details

Methods

sing :: Sing HInt Source #

SingI HProb Source # 
Instance details

Methods

sing :: Sing HProb Source #

SingI HReal Source # 
Instance details

Methods

sing :: Sing HReal Source #

Traversable11 Datum Source # 
Instance details

Methods

traverse11 :: Applicative f => (forall (i :: k1). a i -> f (b i)) -> Datum a j -> f (Datum b j) Source #

Foldable11 Datum Source # 
Instance details

Methods

fold11 :: Monoid m => Datum (Lift1 m) i -> m Source #

foldMap11 :: Monoid m => (forall (i :: k1). a i -> m) -> Datum a j -> m Source #

Functor11 Datum Source # 
Instance details

Methods

fmap11 :: (forall (i :: k1). a i -> b i) -> Datum a j -> Datum b j Source #

JmEq2 PrimCoercion Source # 
Instance details

Methods

jmEq2 :: PrimCoercion i1 j1 -> PrimCoercion i2 j2 -> Maybe (TypeEq i1 i2, TypeEq j1 j2) Source #

Eq2 Coercion Source # 
Instance details

Methods

eq2 :: Coercion i j -> Coercion i j -> Bool Source #

Eq2 PrimCoercion Source # 
Instance details

Methods

eq2 :: PrimCoercion i j -> PrimCoercion i j -> Bool Source #

Traversable11 (DatumFun x :: (Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

traverse11 :: Applicative f => (forall (i :: k1). a i -> f (b i)) -> DatumFun x a j -> f (DatumFun x b j) Source #

Traversable11 (DatumStruct xs :: (Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

traverse11 :: Applicative f => (forall (i :: k1). a i -> f (b i)) -> DatumStruct xs a j -> f (DatumStruct xs b j) Source #

Traversable11 (DatumCode xss :: (Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

traverse11 :: Applicative f => (forall (i :: k1). a i -> f (b i)) -> DatumCode xss a j -> f (DatumCode xss b j) Source #

Foldable11 (DatumFun x :: (Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

fold11 :: Monoid m => DatumFun x (Lift1 m) i -> m Source #

foldMap11 :: Monoid m => (forall (i :: k1). a i -> m) -> DatumFun x a j -> m Source #

Foldable11 (DatumStruct xs :: (Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

fold11 :: Monoid m => DatumStruct xs (Lift1 m) i -> m Source #

foldMap11 :: Monoid m => (forall (i :: k1). a i -> m) -> DatumStruct xs a j -> m Source #

Foldable11 (DatumCode xss :: (Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

fold11 :: Monoid m => DatumCode xss (Lift1 m) i -> m Source #

foldMap11 :: Monoid m => (forall (i :: k1). a i -> m) -> DatumCode xss a j -> m Source #

Functor11 (DatumFun x :: (Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

fmap11 :: (forall (i :: k1). a i -> b i) -> DatumFun x a j -> DatumFun x b j Source #

Functor11 (DatumStruct xs :: (Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

fmap11 :: (forall (i :: k1). a i -> b i) -> DatumStruct xs a j -> DatumStruct xs b j Source #

Functor11 (DatumCode xss :: (Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

fmap11 :: (forall (i :: k1). a i -> b i) -> DatumCode xss a j -> DatumCode xss b j Source #

JmEq1 (Sing :: Hakaru -> *) Source # 
Instance details

Methods

jmEq1 :: Sing i -> Sing j -> Maybe (TypeEq i j) Source #

JmEq1 (PrimCoercion a :: Hakaru -> *) Source # 
Instance details

Methods

jmEq1 :: PrimCoercion a i -> PrimCoercion a j -> Maybe (TypeEq i j) Source #

Eq1 ast => JmEq1 (Datum ast :: Hakaru -> *) Source # 
Instance details

Methods

jmEq1 :: Datum ast i -> Datum ast j -> Maybe (TypeEq i j) Source #

(ABT Term abt, JmEq2 abt) => JmEq1 (Term abt :: Hakaru -> *) Source # 
Instance details

Methods

jmEq1 :: Term abt i -> Term abt j -> Maybe (TypeEq i j) Source #

Eq1 (Sing :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: Sing i -> Sing i -> Bool Source #

Eq1 (Coercion a :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: Coercion a i -> Coercion a i -> Bool Source #

Eq1 (PrimCoercion a :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: PrimCoercion a i -> PrimCoercion a i -> Bool Source #

Eq1 (Pattern vars :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: Pattern vars i -> Pattern vars i -> Bool Source #

Eq1 ast => Eq1 (Datum ast :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: Datum ast i -> Datum ast i -> Bool Source #

(ABT Term abt, JmEq2 abt) => Eq1 (Term abt :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: Term abt i -> Term abt i -> Bool Source #

Eq1 (MeasureOp typs :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: MeasureOp typs i -> MeasureOp typs i -> Bool Source #

Eq1 (ArrayOp args :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: ArrayOp args i -> ArrayOp args i -> Bool Source #

Eq1 (PrimOp args :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: PrimOp args i -> PrimOp args i -> Bool Source #

Show1 (Sing :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Sing i -> ShowS Source #

show1 :: Sing i -> String Source #

Show1 (Pattern vars :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Pattern vars i -> ShowS Source #

show1 :: Pattern vars i -> String Source #

Show1 ast => Show1 (Datum ast :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Datum ast i -> ShowS Source #

show1 :: Datum ast i -> String Source #

Show2 abt => Show1 (LC_ abt :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> LC_ abt i -> ShowS Source #

show1 :: LC_ abt i -> String Source #

Show2 abt => Show1 (Term abt :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Term abt i -> ShowS Source #

show1 :: Term abt i -> String Source #

SingI a => SingI (HMeasure a :: Hakaru) Source # 
Instance details

Methods

sing :: Sing (HMeasure a) Source #

SingI a => SingI (HArray a :: Hakaru) Source # 
Instance details

Methods

sing :: Sing (HArray a) Source #

JmEq2 abt => JmEq1 (Reducer abt xs :: Hakaru -> *) Source # 
Instance details

Methods

jmEq1 :: Reducer abt xs i -> Reducer abt xs j -> Maybe (TypeEq i j) Source #

Eq2 abt => Eq1 (Reducer abt xs :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: Reducer abt xs i -> Reducer abt xs i -> Bool Source #

Eq2 abt => Eq1 (Branch a abt :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: Branch a abt i -> Branch a abt i -> Bool Source #

Eq1 (PDatumFun x vars :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: PDatumFun x vars i -> PDatumFun x vars i -> Bool Source #

Eq1 (PDatumStruct xs vars :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: PDatumStruct xs vars i -> PDatumStruct xs vars i -> Bool Source #

Eq1 (PDatumCode xss vars :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: PDatumCode xss vars i -> PDatumCode xss vars i -> Bool Source #

Eq1 ast => Eq1 (DatumFun x ast :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: DatumFun x ast i -> DatumFun x ast i -> Bool Source #

Eq1 ast => Eq1 (DatumStruct xs ast :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: DatumStruct xs ast i -> DatumStruct xs ast i -> Bool Source #

Eq1 ast => Eq1 (DatumCode xss ast :: Hakaru -> *) Source # 
Instance details

Methods

eq1 :: DatumCode xss ast i -> DatumCode xss ast i -> Bool Source #

Show2 abt => Show1 (Branch a abt :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Branch a abt i -> ShowS Source #

show1 :: Branch a abt i -> String Source #

Show1 (PDatumFun x vars :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> PDatumFun x vars i -> ShowS Source #

show1 :: PDatumFun x vars i -> String Source #

Show1 (PDatumStruct xs vars :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> PDatumStruct xs vars i -> ShowS Source #

show1 :: PDatumStruct xs vars i -> String Source #

Show1 (PDatumCode xss vars :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> PDatumCode xss vars i -> ShowS Source #

show1 :: PDatumCode xss vars i -> String Source #

Show1 ast => Show1 (DatumFun x ast :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> DatumFun x ast i -> ShowS Source #

show1 :: DatumFun x ast i -> String Source #

Show1 ast => Show1 (DatumStruct xs ast :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> DatumStruct xs ast i -> ShowS Source #

show1 :: DatumStruct xs ast i -> String Source #

Show1 ast => Show1 (DatumCode xss ast :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> DatumCode xss ast i -> ShowS Source #

show1 :: DatumCode xss ast i -> String Source #

(Show1 ast, Show2 abt) => Show1 (MatchResult ast abt :: Hakaru -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> MatchResult ast abt i -> ShowS Source #

show1 :: MatchResult ast abt i -> String Source #

(SingI a, SingI b) => SingI (a :-> b :: Hakaru) Source # 
Instance details

Methods

sing :: Sing (a :-> b) Source #

(sop ~ Code t, SingI t, SingI sop) => SingI (HData t sop :: Hakaru) Source # 
Instance details

Methods

sing :: Sing (HData t sop) Source #

ABT Term abt => Eq (Index (abt ([] :: [Hakaru]))) # 
Instance details

Methods

(==) :: Index (abt []) -> Index (abt []) -> Bool #

(/=) :: Index (abt []) -> Index (abt []) -> Bool #

ABT Term abt => Ord (Index (abt ([] :: [Hakaru]))) # 
Instance details

Methods

compare :: Index (abt []) -> Index (abt []) -> Ordering #

(<) :: Index (abt []) -> Index (abt []) -> Bool #

(<=) :: Index (abt []) -> Index (abt []) -> Bool #

(>) :: Index (abt []) -> Index (abt []) -> Bool #

(>=) :: Index (abt []) -> Index (abt []) -> Bool #

max :: Index (abt []) -> Index (abt []) -> Index (abt []) #

min :: Index (abt []) -> Index (abt []) -> Index (abt []) #

Coerce (Sing :: Hakaru -> *) Source # 
Instance details

Methods

coerceTo :: Coercion a b -> Sing a -> Sing b Source #

coerceFrom :: Coercion a b -> Sing b -> Sing a Source #

PrimCoerce (Sing :: Hakaru -> *) Source # 
Instance details
JmEq2 MeasureOp Source # 
Instance details

Methods

jmEq2 :: MeasureOp i1 j1 -> MeasureOp i2 j2 -> Maybe (TypeEq i1 i2, TypeEq j1 j2) Source #

JmEq2 ArrayOp Source # 
Instance details

Methods

jmEq2 :: ArrayOp i1 j1 -> ArrayOp i2 j2 -> Maybe (TypeEq i1 i2, TypeEq j1 j2) Source #

JmEq2 PrimOp Source # 
Instance details

Methods

jmEq2 :: PrimOp i1 j1 -> PrimOp i2 j2 -> Maybe (TypeEq i1 i2, TypeEq j1 j2) Source #

Eq2 Pattern Source # 
Instance details

Methods

eq2 :: Pattern i j -> Pattern i j -> Bool Source #

Eq2 MeasureOp Source # 
Instance details

Methods

eq2 :: MeasureOp i j -> MeasureOp i j -> Bool Source #

Eq2 ArrayOp Source # 
Instance details

Methods

eq2 :: ArrayOp i j -> ArrayOp i j -> Bool Source #

Eq2 PrimOp Source # 
Instance details

Methods

eq2 :: PrimOp i j -> PrimOp i j -> Bool Source #

Show2 Pattern Source # 
Instance details

Methods

showsPrec2 :: Int -> Pattern i j -> ShowS Source #

show2 :: Pattern i j -> String Source #

Traversable21 Term Source # 
Instance details

Methods

traverse21 :: Applicative f => (forall (h :: k1) (i :: k2). a h i -> f (b h i)) -> Term a j -> f (Term b j) Source #

Traversable21 Head Source # 
Instance details

Methods

traverse21 :: Applicative f => (forall (h :: k1) (i :: k2). a h i -> f (b h i)) -> Head a j -> f (Head b j) Source #

Foldable21 Term Source # 
Instance details

Methods

fold21 :: Monoid m => Term (Lift2 m) j -> m Source #

foldMap21 :: Monoid m => (forall (h :: k1) (i :: k2). a h i -> m) -> Term a j -> m Source #

Foldable21 Head Source # 
Instance details

Methods

fold21 :: Monoid m => Head (Lift2 m) j -> m Source #

foldMap21 :: Monoid m => (forall (h :: k1) (i :: k2). a h i -> m) -> Head a j -> m Source #

Functor21 Term Source # 
Instance details

Methods

fmap21 :: (forall (h :: k1) (i :: k2). a h i -> b h i) -> Term a j -> Term b j Source #

Functor21 Head Source # 
Instance details

Methods

fmap21 :: (forall (h :: k1) (i :: k2). a h i -> b h i) -> Head a j -> Head b j Source #

Traversable21 (Branch a :: ([Hakaru] -> Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

traverse21 :: Applicative f => (forall (h :: k1) (i :: k2). a0 h i -> f (b h i)) -> Branch a a0 j -> f (Branch a b j) Source #

Foldable21 (Branch a :: ([Hakaru] -> Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

fold21 :: Monoid m => Branch a (Lift2 m) j -> m Source #

foldMap21 :: Monoid m => (forall (h :: k1) (i :: k2). a0 h i -> m) -> Branch a a0 j -> m Source #

Functor21 (Branch a :: ([Hakaru] -> Hakaru -> *) -> Hakaru -> *) Source # 
Instance details

Methods

fmap21 :: (forall (h :: k1) (i :: k2). a0 h i -> b h i) -> Branch a a0 j -> Branch a b j Source #

Eq2 (PDatumFun x :: [Hakaru] -> Hakaru -> *) Source # 
Instance details

Methods

eq2 :: PDatumFun x i j -> PDatumFun x i j -> Bool Source #

Eq2 (PDatumStruct xs :: [Hakaru] -> Hakaru -> *) Source # 
Instance details

Methods

eq2 :: PDatumStruct xs i j -> PDatumStruct xs i j -> Bool Source #

Eq2 (PDatumCode xss :: [Hakaru] -> Hakaru -> *) Source # 
Instance details

Methods

eq2 :: PDatumCode xss i j -> PDatumCode xss i j -> Bool Source #

Show2 (PDatumFun x :: [Hakaru] -> Hakaru -> *) Source # 
Instance details

Methods

showsPrec2 :: Int -> PDatumFun x i j -> ShowS Source #

show2 :: PDatumFun x i j -> String Source #

Show2 (PDatumStruct xs :: [Hakaru] -> Hakaru -> *) Source # 
Instance details

Methods

showsPrec2 :: Int -> PDatumStruct xs i j -> ShowS Source #

show2 :: PDatumStruct xs i j -> String Source #

Show2 (PDatumCode xss :: [Hakaru] -> Hakaru -> *) Source # 
Instance details

Methods

showsPrec2 :: Int -> PDatumCode xss i j -> ShowS Source #

show2 :: PDatumCode xss i j -> String Source #

Traversable21 SArgs Source # 
Instance details

Methods

traverse21 :: Applicative f => (forall (h :: k1) (i :: k2). a h i -> f (b h i)) -> SArgs a j -> f (SArgs b j) Source #

Foldable21 SArgs Source # 
Instance details

Methods

fold21 :: Monoid m => SArgs (Lift2 m) j -> m Source #

foldMap21 :: Monoid m => (forall (h :: k1) (i :: k2). a h i -> m) -> SArgs a j -> m Source #

Functor21 SArgs Source # 
Instance details

Methods

fmap21 :: (forall (h :: k1) (i :: k2). a h i -> b h i) -> SArgs a j -> SArgs b j Source #

Traversable22 Reducer Source # 
Instance details

Methods

traverse22 :: Applicative f => (forall (h :: k1) (i :: k2). a h i -> f (b h i)) -> Reducer a j l -> f (Reducer b j l) Source #

Foldable22 Reducer Source # 
Instance details

Methods

fold22 :: Monoid m => Reducer (Lift2 m) j l -> m Source #

foldMap22 :: Monoid m => (forall (h :: k1) (i :: k2). a h i -> m) -> Reducer a j l -> m Source #

Functor22 Reducer Source # 
Instance details

Methods

fmap22 :: (forall (h :: k1) (i :: k2). a h i -> b h i) -> Reducer a j l -> Reducer b j l Source #

JmEq2 abt => JmEq1 (SArgs abt :: [([Hakaru], Hakaru)] -> *) Source # 
Instance details

Methods

jmEq1 :: SArgs abt i -> SArgs abt j -> Maybe (TypeEq i j) Source #

Eq2 abt => Eq1 (SArgs abt :: [([Hakaru], Hakaru)] -> *) Source # 
Instance details

Methods

eq1 :: SArgs abt i -> SArgs abt i -> Bool Source #

Show2 abt => Show1 (SArgs abt :: [([Hakaru], Hakaru)] -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> SArgs abt i -> ShowS Source #

show1 :: SArgs abt i -> String Source #

Eq (Sing a) # 
Instance details

Methods

(==) :: Sing a -> Sing a -> Bool #

(/=) :: Sing a -> Sing a -> Bool #

Show (Sing a) # 
Instance details

Methods

showsPrec :: Int -> Sing a -> ShowS #

show :: Sing a -> String #

showList :: [Sing a] -> ShowS #

HasTransformCtx (Variable a) Source # 
Instance details
TCMTypeRepr (Sing x) Source # 
Instance details
Eq (Some2 Transform) # 
Instance details
Read (Some2 Transform) # 
Instance details
data Sing (a :: Hakaru) Source #

Singleton types for the kind of Hakaru types. We need to use this instead of Proxy in order to implement jmEq1.

Instance details

data HakaruFun Source #

The identity and constant functors on Hakaru. This gives us limited access to type-variables in Hakaru, for use in recursive sums-of-products. Notably, however, it only allows a single variable (namely the one bound by the closest binder) so it can't encode mutual recursion or other non-local uses of multiple binders. We also cannot encode non-regular recursive types (aka nested datatypes), like rose trees. To do that, we'd need to allow any old functor here.

Products and sums are represented as lists in the Hakaru data-kind itself, so they aren't in this datatype.

Constructors

I 
K !Hakaru 
Instances
HOrd_ HUnit Source # 
Instance details

Methods

hOrd :: HOrd HUnit Source #

HOrd_ HBool Source # 
Instance details

Methods

hOrd :: HOrd HBool Source #

HEq_ HUnit Source # 
Instance details

Methods

hEq :: HEq HUnit Source #

HEq_ HBool Source # 
Instance details

Methods

hEq :: HEq HBool Source #

SingI I Source # 
Instance details

Methods

sing :: Sing I Source #

Interp HUnit () Source # 
Instance details

Methods

reify :: ABT Term abt => Head abt HUnit -> () Source #

reflect :: ABT Term abt => () -> Head abt HUnit Source #

Interp HBool Bool Source # 
Instance details

Methods

reify :: ABT Term abt => Head abt HBool -> Bool Source #

reflect :: ABT Term abt => Bool -> Head abt HBool Source #

JmEq1 (Sing :: HakaruFun -> *) Source # 
Instance details

Methods

jmEq1 :: Sing i -> Sing j -> Maybe (TypeEq i j) Source #

Eq1 (Sing :: HakaruFun -> *) Source # 
Instance details

Methods

eq1 :: Sing i -> Sing i -> Bool Source #

Show1 (Sing :: HakaruFun -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Sing i -> ShowS Source #

show1 :: Sing i -> String Source #

SingI a => SingI (K a :: HakaruFun) Source # 
Instance details

Methods

sing :: Sing (K a) Source #

JmEq1 (Sing :: [[HakaruFun]] -> *) Source # 
Instance details

Methods

jmEq1 :: Sing i -> Sing j -> Maybe (TypeEq i j) Source #

JmEq1 (Sing :: [HakaruFun] -> *) Source # 
Instance details

Methods

jmEq1 :: Sing i -> Sing j -> Maybe (TypeEq i j) Source #

Eq1 (Sing :: [[HakaruFun]] -> *) Source # 
Instance details

Methods

eq1 :: Sing i -> Sing i -> Bool Source #

Eq1 (Sing :: [HakaruFun] -> *) Source # 
Instance details

Methods

eq1 :: Sing i -> Sing i -> Bool Source #

Show1 (Sing :: [[HakaruFun]] -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Sing i -> ShowS Source #

show1 :: Sing i -> String Source #

Show1 (Sing :: [HakaruFun] -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Sing i -> ShowS Source #

show1 :: Sing i -> String Source #

SingI ([] :: [[HakaruFun]]) Source # 
Instance details

Methods

sing :: Sing [] Source #

SingI ([] :: [HakaruFun]) Source # 
Instance details

Methods

sing :: Sing [] Source #

(SingI xs, SingI xss) => SingI (xs ': xss :: [[HakaruFun]]) Source # 
Instance details

Methods

sing :: Sing (xs ': xss) Source #

(SingI x, SingI xs) => SingI (x ': xs :: [HakaruFun]) Source # 
Instance details

Methods

sing :: Sing (x ': xs) Source #

Eq (Sing a) # 
Instance details

Methods

(==) :: Sing a -> Sing a -> Bool #

(/=) :: Sing a -> Sing a -> Bool #

Eq (Sing a) # 
Instance details

Methods

(==) :: Sing a -> Sing a -> Bool #

(/=) :: Sing a -> Sing a -> Bool #

Eq (Sing a) # 
Instance details

Methods

(==) :: Sing a -> Sing a -> Bool #

(/=) :: Sing a -> Sing a -> Bool #

Show (Sing a) # 
Instance details

Methods

showsPrec :: Int -> Sing a -> ShowS #

show :: Sing a -> String #

showList :: [Sing a] -> ShowS #

Show (Sing a) # 
Instance details

Methods

showsPrec :: Int -> Sing a -> ShowS #

show :: Sing a -> String #

showList :: [Sing a] -> ShowS #

Show (Sing a) # 
Instance details

Methods

showsPrec :: Int -> Sing a -> ShowS #

show :: Sing a -> String #

showList :: [Sing a] -> ShowS #

(HOrd_ a, HOrd_ b) => HOrd_ (HEither a b) Source # 
Instance details

Methods

hOrd :: HOrd (HEither a b) Source #

(HOrd_ a, HOrd_ b) => HOrd_ (HPair a b) Source # 
Instance details

Methods

hOrd :: HOrd (HPair a b) Source #

(HEq_ a, HEq_ b) => HEq_ (HEither a b) Source # 
Instance details

Methods

hEq :: HEq (HEither a b) Source #

(HEq_ a, HEq_ b) => HEq_ (HPair a b) Source # 
Instance details

Methods

hEq :: HEq (HPair a b) Source #

data Sing (a :: HakaruFun) Source # 
Instance details
data Sing (a :: HakaruFun) where
data Sing (a :: [[HakaruFun]]) Source # 
Instance details
data Sing (a :: [[HakaruFun]]) where
data Sing (a :: [HakaruFun]) Source # 
Instance details
data Sing (a :: [HakaruFun]) where

data HakaruCon Source #

The kind of user-defined Hakaru type constructors, which serves as a tag for the sum-of-products representation of the user-defined Hakaru type. The head of the HakaruCon is a symbolic name, and the rest are arguments to that type constructor. The a parameter is parametric, which is especially useful when you need a singleton of the constructor. The argument positions are necessary to do variable binding in Code. Symbol is the kind of "type level strings".

Constructors

TyCon !Symbol 
HakaruCon :@ Hakaru infixl 0 
Instances
JmEq1 (Sing :: HakaruCon -> *) Source # 
Instance details

Methods

jmEq1 :: Sing i -> Sing j -> Maybe (TypeEq i j) Source #

Eq1 (Sing :: HakaruCon -> *) Source # 
Instance details

Methods

eq1 :: Sing i -> Sing i -> Bool Source #

Show1 (Sing :: HakaruCon -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Sing i -> ShowS Source #

show1 :: Sing i -> String Source #

KnownSymbol s => SingI (TyCon s :: HakaruCon) Source # 
Instance details

Methods

sing :: Sing (TyCon s) Source #

(SingI a, SingI b) => SingI (a :@ b :: HakaruCon) Source # 
Instance details

Methods

sing :: Sing (a :@ b) Source #

Eq (Sing a) # 
Instance details

Methods

(==) :: Sing a -> Sing a -> Bool #

(/=) :: Sing a -> Sing a -> Bool #

Show (Sing a) # 
Instance details

Methods

showsPrec :: Int -> Sing a -> ShowS #

show :: Sing a -> String #

showList :: [Sing a] -> ShowS #

data Sing (a :: HakaruCon) Source # 
Instance details
data Sing (a :: HakaruCon) where

data Symbol #

(Kind) This is the kind of type-level symbols. Declared here because class IP needs it

Instances
SingKind Symbol

Since: 4.9.0.0

Instance details

Associated Types

type DemoteRep Symbol :: *

Methods

fromSing :: Sing a -> DemoteRep Symbol

KnownSymbol a => SingI (a :: Symbol)

Since: 4.9.0.0

Instance details

Methods

sing :: Sing a

KnownSymbol s => SingI (s :: Symbol) Source # 
Instance details

Methods

sing :: Sing s Source #

JmEq1 (Sing :: Symbol -> *) Source # 
Instance details

Methods

jmEq1 :: Sing i -> Sing j -> Maybe (TypeEq i j) Source #

Eq1 (Sing :: Symbol -> *) Source # 
Instance details

Methods

eq1 :: Sing i -> Sing i -> Bool Source #

Show1 (Sing :: Symbol -> *) Source # 
Instance details

Methods

showsPrec1 :: Int -> Sing i -> ShowS Source #

show1 :: Sing i -> String Source #

Eq (Sing s) # 
Instance details

Methods

(==) :: Sing s -> Sing s -> Bool #

(/=) :: Sing s -> Sing s -> Bool #

Show (Sing s) # 
Instance details

Methods

showsPrec :: Int -> Sing s -> ShowS #

show :: Sing s -> String #

showList :: [Sing s] -> ShowS #

data Sing (s :: Symbol) 
Instance details
data Sing (s :: Symbol) where
type DemoteRep Symbol 
Instance details
type DemoteRep Symbol = String
data Sing (s :: Symbol) Source #

N.B., in order to bring the KnownSymbol dictionary into scope, you need to pattern match on the SingSymbol constructor (similar to when we need to match on Refl explicitly). In general you'll want to do this with an at-pattern so that you can also have a variable name for passing the value around (e.g. to be used as an argument to symbolVal).

Instance details
data Sing (s :: Symbol) where

type family Code (a :: HakaruCon) :: [[HakaruFun]] Source #

The Code type family allows users to extend the Hakaru language by adding new types. The right hand side is the sum-of-products representation of that type. See the "built-in" types for examples.

Instances
type Code (TyCon "Bool") Source # 
Instance details
type Code (TyCon "Bool") = ([] :: [HakaruFun]) ': (([] :: [HakaruFun]) ': ([] :: [[HakaruFun]]))
type Code (TyCon "Unit") Source # 
Instance details
type Code (TyCon "Unit") = ([] :: [HakaruFun]) ': ([] :: [[HakaruFun]])
type Code (TyCon "List" :@ a) Source # 
Instance details
type Code (TyCon "List" :@ a) = ([] :: [HakaruFun]) ': ((K a ': (I ': ([] :: [HakaruFun]))) ': ([] :: [[HakaruFun]]))
type Code (TyCon "Maybe" :@ a) Source # 
Instance details
type Code (TyCon "Maybe" :@ a) = ([] :: [HakaruFun]) ': ((K a ': ([] :: [HakaruFun])) ': ([] :: [[HakaruFun]]))
type Code ((TyCon "Either" :@ a) :@ b) Source # 
Instance details
type Code ((TyCon "Either" :@ a) :@ b) = (K a ': ([] :: [HakaruFun])) ': ((K b ': ([] :: [HakaruFun])) ': ([] :: [[HakaruFun]]))
type Code ((TyCon "Pair" :@ a) :@ b) Source # 
Instance details
type Code ((TyCon "Pair" :@ a) :@ b) = (K a ': (K b ': ([] :: [HakaruFun]))) ': ([] :: [[HakaruFun]])

type HData' t = HData t (Code t) Source #

A helper type alias for simplifying type signatures for user-provided Hakaru types.

BUG: you cannot use this alias when defining other type aliases! For some reason the type checker doesn't reduce the type family applications, which prevents the use of these type synonyms in class instance heads. Any type synonym created with HData' will suffer the same issue, so type synonyms must be written out by hand— or copied from the GHC pretty printer, which will happily reduce things in the repl, even in the presence of quantified type variables.

Some "built-in" types

type HBool = HData (TyCon "Bool") '['[], '[]] Source #

type HUnit = HData (TyCon "Unit") '['[]] Source #

type HPair a b = HData ((TyCon "Pair" :@ a) :@ b) '['[K a, K b]] Source #

type HEither a b = HData ((TyCon "Either" :@ a) :@ b) '['[K a], '[K b]] Source #

type HList a = HData (TyCon "List" :@ a) '['[], '[K a, I]] Source #

type HMaybe a = HData (TyCon "Maybe" :@ a) '['[], '[K a]] Source #