hakaru-0.3.0: A probabilistic programming language

Safe HaskellNone
LanguageHaskell2010

Language.Hakaru.Parser.AST

Synopsis

Documentation

data Name Source #

Constructors

Name !Nat !Text 

Instances

data Branch' a Source #

Constructors

Branch' (Pattern' Name') (AST' a) 
Branch'' (Pattern' Name) (AST' a) 

Instances

Eq a => Eq (Branch' a) Source # 

Methods

(==) :: Branch' a -> Branch' a -> Bool #

(/=) :: Branch' a -> Branch' a -> Bool #

Show a => Show (Branch' a) Source # 

Methods

showsPrec :: Int -> Branch' a -> ShowS #

show :: Branch' a -> String #

showList :: [Branch' a] -> ShowS #

data Pattern' a Source #

Constructors

PVar' a 
PWild' 
PData' (PDatum a) 

Instances

Eq a => Eq (Pattern' a) Source # 

Methods

(==) :: Pattern' a -> Pattern' a -> Bool #

(/=) :: Pattern' a -> Pattern' a -> Bool #

Show a => Show (Pattern' a) Source # 

Methods

showsPrec :: Int -> Pattern' a -> ShowS #

show :: Pattern' a -> String #

showList :: [Pattern' a] -> ShowS #

data PDatum a Source #

Constructors

DV Name' [Pattern' a] 

Instances

Eq a => Eq (PDatum a) Source # 

Methods

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

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

Show a => Show (PDatum a) Source # 

Methods

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

show :: PDatum a -> String #

showList :: [PDatum a] -> ShowS #

data NaryOp Source #

Constructors

And 
Or 
Xor 
Iff 
Min 
Max 
Sum 
Prod 

Instances

data ArrayOp Source #

Constructors

Index_ 
Size 
Reduce 

data AST' a Source #

Constructors

Var a 
Lam a TypeAST' (AST' a) 
App (AST' a) (AST' a) 
Let a (AST' a) (AST' a) 
If (AST' a) (AST' a) (AST' a) 
Ann (AST' a) TypeAST' 
Infinity' 
ULiteral Literal' 
NaryOp NaryOp [AST' a] 
Unit 
Empty 
Pair (AST' a) (AST' a) 
Array a (AST' a) (AST' a) 
Index (AST' a) (AST' a) 
Case (AST' a) [Branch' a] 
Dirac (AST' a) 
Bind a (AST' a) (AST' a) 
Plate a (AST' a) (AST' a) 
Chain a (AST' a) (AST' a) (AST' a) 
Integrate a (AST' a) (AST' a) (AST' a) 
Summate a (AST' a) (AST' a) (AST' a) 
Product a (AST' a) (AST' a) (AST' a) 
Expect a (AST' a) (AST' a) 
Observe (AST' a) (AST' a) 
Msum [AST' a] 
Data a [TypeAST'] 
WithMeta (AST' a) SourceSpan 

Instances

Eq a => Eq (AST' a) Source # 

Methods

(==) :: AST' a -> AST' a -> Bool #

(/=) :: AST' a -> AST' a -> Bool #

Show a => Show (AST' a) Source # 

Methods

showsPrec :: Int -> AST' a -> ShowS #

show :: AST' a -> String #

showList :: [AST' a] -> ShowS #

data Import a Source #

Constructors

Import a 

Instances

Eq a => Eq (Import a) Source # 

Methods

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

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

Show a => Show (Import a) Source # 

Methods

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

show :: Import a -> String #

showList :: [Import a] -> ShowS #

data SomeOp op where Source #

Constructors

SomeOp :: (typs ~ UnLCs args, args ~ LCs typs) => !(op typs a) -> SomeOp op 

data SSing Source #

Constructors

SSing !(Sing a) 

data Branch_ abt Source #

Constructors

Branch_ Pattern (abt '[] U) 

fmapBranch :: (f '[] U -> g '[] U) -> Branch_ f -> Branch_ g Source #

foldBranch :: (abt '[] U -> m) -> Branch_ abt -> m Source #

data Pattern Source #

Constructors

PWild 
PVar Name 
PDatum Text PCode 

data PFun Source #

Constructors

PKonst Pattern 
PIdent Pattern 

data PStruct Source #

Constructors

PEt PFun PStruct infixr 7 
PDone 

data PCode Source #

Constructors

PInr PCode 
PInl PStruct 

data DFun abt Source #

Constructors

Konst (abt '[] U) 
Ident (abt '[] U) 

data DStruct abt Source #

Constructors

Et (DFun abt) (DStruct abt) infixr 7 
Done 

data DCode abt Source #

Constructors

Inr (DCode abt) 
Inl (DStruct abt) 

data Datum abt Source #

Constructors

Datum Text (DCode abt) 

fmapDatum :: (f '[] U -> g '[] U) -> Datum f -> Datum g Source #

foldDatum :: Monoid m => (abt '[] U -> m) -> Datum abt -> m Source #

data Untyped Source #

The kind containing exactly one type.

Constructors

U 

Instances

Read Untyped Source # 
Show Untyped Source # 
SingI Untyped U Source # 

Methods

sing :: Sing U a Source #

Foldable21 Untyped Untyped [Untyped] Term Source # 

Methods

fold21 :: Monoid m => f (Lift2 k2 k1 m) j -> m Source #

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

Functor21 Untyped Untyped [Untyped] Term Source # 

Methods

fmap21 :: (forall h i. a h i -> b h i) -> f a j -> f b j Source #

JmEq1 Untyped (Sing Untyped) Source # 

Methods

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

Eq1 Untyped (Sing Untyped) Source # 

Methods

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

Show1 Untyped (Sing Untyped) Source # 

Methods

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

show1 :: a i -> String Source #

Eq (Sing Untyped a) Source # 

Methods

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

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

Show (Sing Untyped a) Source # 
data Sing Untyped Source # 
data Sing Untyped where

data Term :: ([Untyped] -> Untyped -> *) -> Untyped -> * where Source #

Constructors

Lam_ :: SSing -> abt '[U] U -> Term abt U 
App_ :: abt '[] U -> abt '[] U -> Term abt U 
Let_ :: abt '[] U -> abt '[U] U -> Term abt U 
Ann_ :: SSing -> abt '[] U -> Term abt U 
CoerceTo_ :: Some2 Coercion -> abt '[] U -> Term abt U 
UnsafeTo_ :: Some2 Coercion -> abt '[] U -> Term abt U 
PrimOp_ :: PrimOp -> [abt '[] U] -> Term abt U 
ArrayOp_ :: ArrayOp -> [abt '[] U] -> Term abt U 
MeasureOp_ :: SomeOp MeasureOp -> [abt '[] U] -> Term abt U 
NaryOp_ :: NaryOp -> [abt '[] U] -> Term abt U 
Literal_ :: Some1 Literal -> Term abt U 
Empty_ :: Term abt U 
Pair_ :: abt '[] U -> abt '[] U -> Term abt U 
Array_ :: abt '[] U -> abt '[U] U -> Term abt U 
Datum_ :: Datum abt -> Term abt U 
Case_ :: abt '[] U -> [Branch_ abt] -> Term abt U 
Dirac_ :: abt '[] U -> Term abt U 
MBind_ :: abt '[] U -> abt '[U] U -> Term abt U 
Plate_ :: abt '[] U -> abt '[U] U -> Term abt U 
Chain_ :: abt '[] U -> abt '[] U -> abt '[U] U -> Term abt U 
Integrate_ :: abt '[] U -> abt '[] U -> abt '[U] U -> Term abt U 
Summate_ :: abt '[] U -> abt '[] U -> abt '[U] U -> Term abt U 
Product_ :: abt '[] U -> abt '[] U -> abt '[U] U -> Term abt U 
Expect_ :: abt '[] U -> abt '[U] U -> Term abt U 
Observe_ :: abt '[] U -> abt '[] U -> Term abt U 
Superpose_ :: NonEmpty (abt '[] U, abt '[] U) -> Term abt U 
Reject_ :: Term abt U 

Instances

Foldable21 Untyped Untyped [Untyped] Term Source # 

Methods

fold21 :: Monoid m => f (Lift2 k2 k1 m) j -> m Source #

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

Functor21 Untyped Untyped [Untyped] Term Source # 

Methods

fmap21 :: (forall h i. a h i -> b h i) -> f a j -> f b j Source #