dino-0.1: A convenient tagless EDSL

Safe HaskellNone
LanguageHaskell2010

Dino.Interpretation

Contents

Description

Interpretation of tagless expressions

Synopsis

Type checking

Monadic interpretation

eval :: Exp Identity a -> a Source #

Pure evaluation

evalF :: Exp f a -> f a Source #

Functorial evaluation

Can, for example, have the type

evalF :: Exp Maybe a -> Maybe a

Folding

newtype Fold e a Source #

A folding interpretation

Instances of expression classes work by monoidal folding over e (see foldMonoid).

Constructors

Fold 

Fields

Instances
Functor (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

fmap :: (a -> b) -> Fold e a -> Fold e b #

(<$) :: a -> Fold e b -> Fold e a #

Monoid e => Applicative (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

pure :: a -> Fold e a #

(<*>) :: Fold e (a -> b) -> Fold e a -> Fold e b #

liftA2 :: (a -> b -> c) -> Fold e a -> Fold e b -> Fold e c #

(*>) :: Fold e a -> Fold e b -> Fold e b #

(<*) :: Fold e a -> Fold e b -> Fold e a #

AssertExp (Fold e) Source #

Ignoring assertion

Instance details

Defined in Dino.Interpretation

Methods

assert :: Text -> Fold e Bool -> Fold e a -> Fold e a Source #

assertEq :: (Eq a, Show a) => Text -> Fold e a -> Fold e a -> Fold e a Source #

Monoid e => FieldExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> Fold e r -> Fold e a Source #

Monoid e => LetExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

letE :: DinoType a => Text -> Fold e a -> (Fold e a -> Fold e b) -> Fold e b Source #

Monoid e => TupleExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

pair :: Fold e a -> Fold e b -> Fold e (a, b) Source #

fstE :: Fold e (a, b) -> Fold e a Source #

sndE :: Fold e (a, b) -> Fold e b Source #

Monoid e => ListExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapE :: DinoType a => (Fold e a -> Fold e b) -> Fold e [a] -> Fold e [b] Source #

dropWhileE :: DinoType a => (Fold e a -> Fold e Bool) -> Fold e [a] -> Fold e [a] Source #

foldE :: (DinoType a, DinoType b) => (Fold e a -> Fold e b -> Fold e a) -> Fold e a -> Fold e [b] -> Fold e a Source #

Monoid e => ListExpFO (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

range :: Enum a => Fold e a -> Fold e a -> Fold e [a] Source #

list :: DinoType a => [Fold e a] -> Fold e [a] Source #

headE :: Fold e [a] -> Fold e (Maybe a) Source #

append :: Fold e [a] -> Fold e [a] -> Fold e [a] Source #

Monoid e => CondExp (Fold e) Source #

Interprets all branches

Instance details

Defined in Dino.Interpretation

Methods

maybe :: DinoType a => Fold e b -> (Fold e a -> Fold e b) -> Fold e (Maybe a) -> Fold e b Source #

Monoid e => CondExpFO (Fold e) Source #

Interprets all branches

Instance details

Defined in Dino.Interpretation

Methods

just :: Fold e a -> Fold e (Maybe a) Source #

cases :: [Fold e Bool :-> Fold e a] -> (Otherwise :-> Fold e a) -> Fold e a Source #

partial_cases :: HasCallStack => [Fold e Bool :-> Fold e a] -> Fold e a Source #

Monoid e => CompareExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

eq :: Eq a => Fold e a -> Fold e a -> Fold e Bool Source #

neq :: Eq a => Fold e a -> Fold e a -> Fold e Bool Source #

lt :: Ord a => Fold e a -> Fold e a -> Fold e Bool Source #

gt :: Ord a => Fold e a -> Fold e a -> Fold e Bool Source #

lte :: Ord a => Fold e a -> Fold e a -> Fold e Bool Source #

gte :: Ord a => Fold e a -> Fold e a -> Fold e Bool Source #

min :: Ord a => Fold e a -> Fold e a -> Fold e a Source #

max :: Ord a => Fold e a -> Fold e a -> Fold e a Source #

Monoid e => LogicExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

not :: Fold e Bool -> Fold e Bool Source #

conj :: Fold e Bool -> Fold e Bool -> Fold e Bool Source #

disj :: Fold e Bool -> Fold e Bool -> Fold e Bool Source #

xor :: Fold e Bool -> Fold e Bool -> Fold e Bool Source #

Monoid e => FracExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

fdiv :: (Fractional a, Eq a) => Fold e a -> Fold e a -> Fold e a Source #

Monoid e => NumExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

add :: Num a => Fold e a -> Fold e a -> Fold e a Source #

sub :: Num a => Fold e a -> Fold e a -> Fold e a Source #

mul :: Num a => Fold e a -> Fold e a -> Fold e a Source #

absE :: Num a => Fold e a -> Fold e a Source #

signE :: Num a => Fold e a -> Fold e a Source #

fromIntegral :: (Integral a, DinoType b, Num b) => Fold e a -> Fold e b Source #

floor :: (RealFrac a, DinoType b, Integral b) => Fold e a -> Fold e b Source #

truncate :: (RealFrac a, DinoType b, Integral b) => Fold e a -> Fold e b Source #

roundN :: RealFrac a => Int -> Fold e a -> Fold e a Source #

Monoid e => ConstExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

lit :: DinoType a => a -> Fold e a Source #

Semigroup e => LetIntensional (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

letI :: DinoType a => Text -> Fold e a -> Fold e b -> Fold e b Source #

Semigroup e => ListIntensional (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapI :: DinoType a => Text -> Fold e b -> Fold e [a] -> Fold e [b] Source #

dropWhileI :: DinoType a => Text -> Fold e Bool -> Fold e [a] -> Fold e [a] Source #

foldI :: (DinoType a, DinoType b) => Text -> Text -> Fold e a -> Fold e a -> Fold e [b] -> Fold e a Source #

Semigroup e => CondIntensional (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

maybeI :: DinoType a => Text -> Fold e b -> Fold e b -> Fold e (Maybe a) -> Fold e b Source #

Monoid e => VarExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> Fold e a Source #

AnnExp ann (Fold e :: Type -> Type) Source # 
Instance details

Defined in Dino.Interpretation

Methods

ann :: ann -> Fold e a -> Fold e a Source #

Eq e => Eq (Fold e a) Source # 
Instance details

Defined in Dino.Interpretation

Methods

(==) :: Fold e a -> Fold e a -> Bool #

(/=) :: Fold e a -> Fold e a -> Bool #

Show e => Show (Fold e a) Source # 
Instance details

Defined in Dino.Interpretation

Methods

showsPrec :: Int -> Fold e a -> ShowS #

show :: Fold e a -> String #

showList :: [Fold e a] -> ShowS #

Semigroup e => Semigroup (Fold e a) Source # 
Instance details

Defined in Dino.Interpretation

Methods

(<>) :: Fold e a -> Fold e a -> Fold e a #

sconcat :: NonEmpty (Fold e a) -> Fold e a #

stimes :: Integral b => b -> Fold e a -> Fold e a #

Monoid e => Monoid (Fold e a) Source # 
Instance details

Defined in Dino.Interpretation

Methods

mempty :: Fold e a #

mappend :: Fold e a -> Fold e a -> Fold e a #

mconcat :: [Fold e a] -> Fold e a #

FoldN f e => FoldN (Fold e a -> f) e Source # 
Instance details

Defined in Dino.Interpretation

Methods

foldN :: e -> (e -> e -> e) -> Fold e a -> f Source #

FoldN (Fold e a) e Source # 
Instance details

Defined in Dino.Interpretation

Methods

foldN :: e -> (e -> e -> e) -> Fold e a Source #

class FoldN f e | f -> e where Source #

N-ary folding functions

Methods

foldN :: e -> (e -> e -> e) -> f Source #

foldN e (*) returns an n-ary function of the following form:

\(Fold a) (Fold b) ... (Fold x) -> Fold (e * a * b * ... x)

(here * denotes any binary operator, and it's assumed to be right- associative.)

Instances
FoldN f e => FoldN (Fold e a -> f) e Source # 
Instance details

Defined in Dino.Interpretation

Methods

foldN :: e -> (e -> e -> e) -> Fold e a -> f Source #

FoldN (Fold e a) e Source # 
Instance details

Defined in Dino.Interpretation

Methods

foldN :: e -> (e -> e -> e) -> Fold e a Source #

foldMonoid :: (FoldN f e, Monoid e) => f Source #

@foldMonoid returns an n-ary function of the following form:

\(Fold a) (Fold b) ... (Fold x) -> Fold (mempty <> a <> b <> ... x)

where mempty and <> are the methods of the Monoid class.

Product of interpretations

data (e1 :×: e2) a Source #

Product of two interpretations

The product is used to run two interpretations in parallel. Note that there are no instances for HOS classes. Instead, use Intensional (e1 :×: e2) in order to derive an interpretation of HOS classes for products.

Constructors

(:×:) 

Fields

Instances
(AnnExp ann e1, AnnExp ann e2) => AnnExp ann (e1 :×: e2 :: Type -> Type) Source # 
Instance details

Defined in Dino.Interpretation

Methods

ann :: ann -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

(AssertExp e1, AssertExp e2) => AssertExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

assert :: Text -> (e1 :×: e2) Bool -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

assertEq :: (Eq a, Show a) => Text -> (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

(FieldExp e1, FieldExp e2) => FieldExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> (e1 :×: e2) r -> (e1 :×: e2) a Source #

(TupleExp e1, TupleExp e2) => TupleExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

pair :: (e1 :×: e2) a -> (e1 :×: e2) b -> (e1 :×: e2) (a, b) Source #

fstE :: (e1 :×: e2) (a, b) -> (e1 :×: e2) a Source #

sndE :: (e1 :×: e2) (a, b) -> (e1 :×: e2) b Source #

(ListExpFO e1, ListExpFO e2) => ListExpFO (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

range :: Enum a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) [a] Source #

list :: DinoType a => [(e1 :×: e2) a] -> (e1 :×: e2) [a] Source #

headE :: (e1 :×: e2) [a] -> (e1 :×: e2) (Maybe a) Source #

append :: (e1 :×: e2) [a] -> (e1 :×: e2) [a] -> (e1 :×: e2) [a] Source #

(CondExpFO e1, CondExpFO e2) => CondExpFO (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

just :: (e1 :×: e2) a -> (e1 :×: e2) (Maybe a) Source #

cases :: [(e1 :×: e2) Bool :-> (e1 :×: e2) a] -> (Otherwise :-> (e1 :×: e2) a) -> (e1 :×: e2) a Source #

partial_cases :: HasCallStack => [(e1 :×: e2) Bool :-> (e1 :×: e2) a] -> (e1 :×: e2) a Source #

(CompareExp e1, CompareExp e2) => CompareExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

eq :: Eq a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) Bool Source #

neq :: Eq a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) Bool Source #

lt :: Ord a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) Bool Source #

gt :: Ord a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) Bool Source #

lte :: Ord a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) Bool Source #

gte :: Ord a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) Bool Source #

min :: Ord a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

max :: Ord a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

(LogicExp e1, LogicExp e2) => LogicExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

not :: (e1 :×: e2) Bool -> (e1 :×: e2) Bool Source #

conj :: (e1 :×: e2) Bool -> (e1 :×: e2) Bool -> (e1 :×: e2) Bool Source #

disj :: (e1 :×: e2) Bool -> (e1 :×: e2) Bool -> (e1 :×: e2) Bool Source #

xor :: (e1 :×: e2) Bool -> (e1 :×: e2) Bool -> (e1 :×: e2) Bool Source #

(FracExp e1, FracExp e2) => FracExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

fdiv :: (Fractional a, Eq a) => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

(NumExp e1, NumExp e2) => NumExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

add :: Num a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

sub :: Num a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

mul :: Num a => (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

absE :: Num a => (e1 :×: e2) a -> (e1 :×: e2) a Source #

signE :: Num a => (e1 :×: e2) a -> (e1 :×: e2) a Source #

fromIntegral :: (Integral a, DinoType b, Num b) => (e1 :×: e2) a -> (e1 :×: e2) b Source #

floor :: (RealFrac a, DinoType b, Integral b) => (e1 :×: e2) a -> (e1 :×: e2) b Source #

truncate :: (RealFrac a, DinoType b, Integral b) => (e1 :×: e2) a -> (e1 :×: e2) b Source #

roundN :: RealFrac a => Int -> (e1 :×: e2) a -> (e1 :×: e2) a Source #

(ConstExp e1, ConstExp e2) => ConstExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

lit :: DinoType a => a -> (e1 :×: e2) a Source #

(LetIntensional e1, LetIntensional e2) => LetIntensional (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

letI :: DinoType a => Text -> (e1 :×: e2) a -> (e1 :×: e2) b -> (e1 :×: e2) b Source #

(ListIntensional e1, ListIntensional e2) => ListIntensional (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapI :: DinoType a => Text -> (e1 :×: e2) b -> (e1 :×: e2) [a] -> (e1 :×: e2) [b] Source #

dropWhileI :: DinoType a => Text -> (e1 :×: e2) Bool -> (e1 :×: e2) [a] -> (e1 :×: e2) [a] Source #

foldI :: (DinoType a, DinoType b) => Text -> Text -> (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) [b] -> (e1 :×: e2) a Source #

(CondIntensional e1, CondIntensional e2) => CondIntensional (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

maybeI :: DinoType a => Text -> (e1 :×: e2) b -> (e1 :×: e2) b -> (e1 :×: e2) (Maybe a) -> (e1 :×: e2) b Source #

(VarExp e1, VarExp e2) => VarExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> (e1 :×: e2) a Source #

mkProd :: (lang e1, lang e2) => proxy lang -> (forall e. lang e => e a) -> (e1 :×: e2) a Source #

liftProd :: (lang e1, lang e2) => proxy lang -> (forall e. lang e => e a -> e b) -> (e1 :×: e2) a -> (e1 :×: e2) b Source #

liftProd2 :: (lang e1, lang e2) => proxy lang -> (forall e. lang e => e a -> e b -> e c) -> (e1 :×: e2) a -> (e1 :×: e2) b -> (e1 :×: e2) c Source #

liftProd3 :: (lang e1, lang e2) => proxy lang -> (forall e. lang e => e a -> e b -> e c -> e d) -> (e1 :×: e2) a -> (e1 :×: e2) b -> (e1 :×: e2) c -> (e1 :×: e2) d Source #

Intensional interpretation

type BindSet = HashMap Text Int Source #

Representation of the set of variables used by bindings in an expression. An entry (v, n) means that the base name v is used possibly appended with a number that is at most n.

Since the keys represent variable base names, they are not allowed to end with digits.

freshVar :: Text -> BindSet -> (Text, BindSet) Source #

Return an unused variable name from the given base name

The returned BindSet includes the new variable.

newtype Intensional e a Source #

Allow intensional interpretation of higher-order constructs

Intensional is used to obtain instances of HOS classes from their intensional counterparts. For example, given (CondExpFO e, VarExp e, CondIntensional e), we get CondExp (Intensional e).

Pairing the interpretation with a BindSet allows generating symbolic variables to inspect higher-order constructs rather than just running them.

Constructors

Intensional 

Fields

Instances
AssertExp e => AssertExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

assert :: Text -> Intensional e Bool -> Intensional e a -> Intensional e a Source #

assertEq :: (Eq a, Show a) => Text -> Intensional e a -> Intensional e a -> Intensional e a Source #

FieldExp e => FieldExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> Intensional e r -> Intensional e a Source #

(VarExp e, LetIntensional e) => LetExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

letE :: DinoType a => Text -> Intensional e a -> (Intensional e a -> Intensional e b) -> Intensional e b Source #

TupleExp e => TupleExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

pair :: Intensional e a -> Intensional e b -> Intensional e (a, b) Source #

fstE :: Intensional e (a, b) -> Intensional e a Source #

sndE :: Intensional e (a, b) -> Intensional e b Source #

(ListExpFO e, VarExp e, ListIntensional e) => ListExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapE :: DinoType a => (Intensional e a -> Intensional e b) -> Intensional e [a] -> Intensional e [b] Source #

dropWhileE :: DinoType a => (Intensional e a -> Intensional e Bool) -> Intensional e [a] -> Intensional e [a] Source #

foldE :: (DinoType a, DinoType b) => (Intensional e a -> Intensional e b -> Intensional e a) -> Intensional e a -> Intensional e [b] -> Intensional e a Source #

ListExpFO e => ListExpFO (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

range :: Enum a => Intensional e a -> Intensional e a -> Intensional e [a] Source #

list :: DinoType a => [Intensional e a] -> Intensional e [a] Source #

headE :: Intensional e [a] -> Intensional e (Maybe a) Source #

append :: Intensional e [a] -> Intensional e [a] -> Intensional e [a] Source #

(CondExpFO e, VarExp e, CondIntensional e) => CondExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

maybe :: DinoType a => Intensional e b -> (Intensional e a -> Intensional e b) -> Intensional e (Maybe a) -> Intensional e b Source #

CondExpFO e => CondExpFO (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

CompareExp e => CompareExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

LogicExp e => LogicExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

FracExp e => FracExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

fdiv :: (Fractional a, Eq a) => Intensional e a -> Intensional e a -> Intensional e a Source #

NumExp e => NumExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

ConstExp e => ConstExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

lit :: DinoType a => a -> Intensional e a Source #

VarExp e => VarExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> Intensional e a Source #

AnnExp ann e => AnnExp ann (Intensional e :: Type -> Type) Source # 
Instance details

Defined in Dino.Interpretation

Methods

ann :: ann -> Intensional e a -> Intensional e a Source #

liftIntensional :: (e a -> e b) -> Intensional e a -> Intensional e b Source #

liftIntensional2 :: (e a -> e b -> e c) -> Intensional e a -> Intensional e b -> Intensional e c Source #

liftIntensional3 :: (e a -> e b -> e c -> e d) -> Intensional e a -> Intensional e b -> Intensional e c -> Intensional e d Source #

class VarExp e where Source #

Named variable expressions

This class is only used to internally to create intensional interpretations. It should not be exposed to the EDSL user.

Methods

varE Source #

Arguments

:: DinoType a 
=> Text

Variable name

-> e a 

Create a named variable

Instances
VarExp Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> Reified a Source #

VarExp e => VarExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> CollectAssertions e a Source #

Monad e => VarExp (EvalEnv e) Source #

Throws EvalEnvError when variable is not in scope or has the wrong type

Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> EvalEnv e a Source #

VarExp e => VarExp (Intensional e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> Intensional e a Source #

Monoid e => VarExp (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> Fold e a Source #

(VarExp e1, VarExp e2) => VarExp (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> (e1 :×: e2) a Source #

unbind Source #

Arguments

:: (VarExp e, DinoType a) 
=> Text

Variable base name

-> (Intensional e a -> Intensional e b)

Body parameterized by its free variable

-> (Text, Intensional e b)

Generated variable and function body

Open up a binder represented as a Haskell function

This function helps creating intensional interpretations of higher-order constructs.

unbind2 Source #

Arguments

:: (VarExp e, DinoType a, DinoType b) 
=> Text

Variable base name

-> (Intensional e a -> Intensional e b -> Intensional e c)

Body parameterized by its free variables

-> (Text, Text, Intensional e c)

Generated variables and function body

A version of unbind for 2-argument functions

class CondIntensional e where Source #

Intensional counterpart of CondExp

Methods

maybeI Source #

Arguments

:: DinoType a 
=> Text

Variable name

-> e b 
-> e b

Result when just (open term)

-> e (Maybe a) 
-> e b 

Intensional counterpart of maybe

Instances
CondIntensional Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

maybeI :: DinoType a => Text -> Reified b -> Reified b -> Reified (Maybe a) -> Reified b Source #

Monad e => CondIntensional (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

maybeI :: DinoType a => Text -> EvalEnv e b -> EvalEnv e b -> EvalEnv e (Maybe a) -> EvalEnv e b Source #

Semigroup e => CondIntensional (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

maybeI :: DinoType a => Text -> Fold e b -> Fold e b -> Fold e (Maybe a) -> Fold e b Source #

(CondIntensional e1, CondIntensional e2) => CondIntensional (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

maybeI :: DinoType a => Text -> (e1 :×: e2) b -> (e1 :×: e2) b -> (e1 :×: e2) (Maybe a) -> (e1 :×: e2) b Source #

class ListIntensional e where Source #

Intensional counterpart of ListExp

Methods

mapI Source #

Arguments

:: DinoType a 
=> Text

Variable name

-> e b

Body (open term)

-> e [a] 
-> e [b] 

Intensional counterpart of mapE

dropWhileI Source #

Arguments

:: DinoType a 
=> Text

Name of element variable

-> e Bool

Predicate body (open term)

-> e [a] 
-> e [a] 

Intensional counterpart of dropWhileE

foldI Source #

Arguments

:: (DinoType a, DinoType b) 
=> Text

Name of state variable

-> Text

Name of element variable

-> e a

Body (term with two free variables)

-> e a 
-> e [b] 
-> e a 

Intensional counterpart of foldE

Instances
ListIntensional Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapI :: DinoType a => Text -> Reified b -> Reified [a] -> Reified [b] Source #

dropWhileI :: DinoType a => Text -> Reified Bool -> Reified [a] -> Reified [a] Source #

foldI :: (DinoType a, DinoType b) => Text -> Text -> Reified a -> Reified a -> Reified [b] -> Reified a Source #

Monad e => ListIntensional (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapI :: DinoType a => Text -> EvalEnv e b -> EvalEnv e [a] -> EvalEnv e [b] Source #

dropWhileI :: DinoType a => Text -> EvalEnv e Bool -> EvalEnv e [a] -> EvalEnv e [a] Source #

foldI :: (DinoType a, DinoType b) => Text -> Text -> EvalEnv e a -> EvalEnv e a -> EvalEnv e [b] -> EvalEnv e a Source #

Semigroup e => ListIntensional (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapI :: DinoType a => Text -> Fold e b -> Fold e [a] -> Fold e [b] Source #

dropWhileI :: DinoType a => Text -> Fold e Bool -> Fold e [a] -> Fold e [a] Source #

foldI :: (DinoType a, DinoType b) => Text -> Text -> Fold e a -> Fold e a -> Fold e [b] -> Fold e a Source #

(ListIntensional e1, ListIntensional e2) => ListIntensional (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapI :: DinoType a => Text -> (e1 :×: e2) b -> (e1 :×: e2) [a] -> (e1 :×: e2) [b] Source #

dropWhileI :: DinoType a => Text -> (e1 :×: e2) Bool -> (e1 :×: e2) [a] -> (e1 :×: e2) [a] Source #

foldI :: (DinoType a, DinoType b) => Text -> Text -> (e1 :×: e2) a -> (e1 :×: e2) a -> (e1 :×: e2) [b] -> (e1 :×: e2) a Source #

class LetIntensional e where Source #

Intensional counterpart of LetExp

Methods

letI Source #

Arguments

:: DinoType a 
=> Text

Variable name

-> e a 
-> e b

Body (open term)

-> e b 

Intensional counterpart of letE

Instances
LetIntensional Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

letI :: DinoType a => Text -> Reified a -> Reified b -> Reified b Source #

Monad e => LetIntensional (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

letI :: DinoType a => Text -> EvalEnv e a -> EvalEnv e b -> EvalEnv e b Source #

Semigroup e => LetIntensional (Fold e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

letI :: DinoType a => Text -> Fold e a -> Fold e b -> Fold e b Source #

(LetIntensional e1, LetIntensional e2) => LetIntensional (e1 :×: e2) Source # 
Instance details

Defined in Dino.Interpretation

Methods

letI :: DinoType a => Text -> (e1 :×: e2) a -> (e1 :×: e2) b -> (e1 :×: e2) b Source #

AST reification

newtype NumRep Source #

Generic representation of numbers using Rational

Constructors

NumRep 

Fields

Instances
Eq NumRep Source # 
Instance details

Defined in Dino.Interpretation

Methods

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

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

Fractional NumRep Source # 
Instance details

Defined in Dino.Interpretation

Num NumRep Source # 
Instance details

Defined in Dino.Interpretation

Ord NumRep Source # 
Instance details

Defined in Dino.Interpretation

Real NumRep Source # 
Instance details

Defined in Dino.Interpretation

Show NumRep Source #

Integers are show exactly, non-integers are shown at Double precision.

Instance details

Defined in Dino.Interpretation

Hashable NumRep Source # 
Instance details

Defined in Dino.Interpretation

Methods

hashWithSalt :: Int -> NumRep -> Int #

hash :: NumRep -> Int #

newtype Reified a Source #

Expression reified as an AST

Constructors

Reified 

Fields

Instances
AssertExp Reified Source #

Ignores the assertion

Instance details

Defined in Dino.Interpretation

Methods

assert :: Text -> Reified Bool -> Reified a -> Reified a Source #

assertEq :: (Eq a, Show a) => Text -> Reified a -> Reified a -> Reified a Source #

FieldExp Reified Source #

Field name prepended with #

Instance details

Defined in Dino.Interpretation

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> Reified r -> Reified a Source #

TupleExp Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

pair :: Reified a -> Reified b -> Reified (a, b) Source #

fstE :: Reified (a, b) -> Reified a Source #

sndE :: Reified (a, b) -> Reified b Source #

ListExpFO Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

range :: Enum a => Reified a -> Reified a -> Reified [a] Source #

list :: DinoType a => [Reified a] -> Reified [a] Source #

headE :: Reified [a] -> Reified (Maybe a) Source #

append :: Reified [a] -> Reified [a] -> Reified [a] Source #

CondExpFO Reified Source # 
Instance details

Defined in Dino.Interpretation

CompareExp Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

eq :: Eq a => Reified a -> Reified a -> Reified Bool Source #

neq :: Eq a => Reified a -> Reified a -> Reified Bool Source #

lt :: Ord a => Reified a -> Reified a -> Reified Bool Source #

gt :: Ord a => Reified a -> Reified a -> Reified Bool Source #

lte :: Ord a => Reified a -> Reified a -> Reified Bool Source #

gte :: Ord a => Reified a -> Reified a -> Reified Bool Source #

min :: Ord a => Reified a -> Reified a -> Reified a Source #

max :: Ord a => Reified a -> Reified a -> Reified a Source #

LogicExp Reified Source # 
Instance details

Defined in Dino.Interpretation

FracExp Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

fdiv :: (Fractional a, Eq a) => Reified a -> Reified a -> Reified a Source #

NumExp Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

add :: Num a => Reified a -> Reified a -> Reified a Source #

sub :: Num a => Reified a -> Reified a -> Reified a Source #

mul :: Num a => Reified a -> Reified a -> Reified a Source #

absE :: Num a => Reified a -> Reified a Source #

signE :: Num a => Reified a -> Reified a Source #

fromIntegral :: (Integral a, DinoType b, Num b) => Reified a -> Reified b Source #

floor :: (RealFrac a, DinoType b, Integral b) => Reified a -> Reified b Source #

truncate :: (RealFrac a, DinoType b, Integral b) => Reified a -> Reified b Source #

roundN :: RealFrac a => Int -> Reified a -> Reified a Source #

ConstExp Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

lit :: DinoType a => a -> Reified a Source #

LetIntensional Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

letI :: DinoType a => Text -> Reified a -> Reified b -> Reified b Source #

ListIntensional Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapI :: DinoType a => Text -> Reified b -> Reified [a] -> Reified [b] Source #

dropWhileI :: DinoType a => Text -> Reified Bool -> Reified [a] -> Reified [a] Source #

foldI :: (DinoType a, DinoType b) => Text -> Text -> Reified a -> Reified a -> Reified [b] -> Reified a Source #

CondIntensional Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

maybeI :: DinoType a => Text -> Reified b -> Reified b -> Reified (Maybe a) -> Reified b Source #

VarExp Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> Reified a Source #

Inspectable (Reified a) Source # 
Instance details

Defined in Dino.Interpretation

AnnExp Text Reified Source # 
Instance details

Defined in Dino.Interpretation

Methods

ann :: Text -> Reified a -> Reified a Source #

Evaluation with variables

newtype EvalEnv e a Source #

Interpretation wrapper that evaluates using a variable environment rather than piggybacking on higher-order syntax

EvalEnv lacks instances of HOS classes. Instead, it provides instances of 'intensional classes. In order to regain the missing HOS instances, EvalEnv 'can be wrapped in Intensional.

Intensional (EvalEnv e) is essentially equivalent to e, when e is a Monad.

The purpose of EvalEnv is to be used when evaluation must be done under Intensional. For example, this happens when combining reification and evaluation.

Constructors

EvalEnv 
Instances
Monad e => Monad (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

(>>=) :: EvalEnv e a -> (a -> EvalEnv e b) -> EvalEnv e b #

(>>) :: EvalEnv e a -> EvalEnv e b -> EvalEnv e b #

return :: a -> EvalEnv e a #

fail :: String -> EvalEnv e a #

Functor e => Functor (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

fmap :: (a -> b) -> EvalEnv e a -> EvalEnv e b #

(<$) :: a -> EvalEnv e b -> EvalEnv e a #

Applicative e => Applicative (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

pure :: a -> EvalEnv e a #

(<*>) :: EvalEnv e (a -> b) -> EvalEnv e a -> EvalEnv e b #

liftA2 :: (a -> b -> c) -> EvalEnv e a -> EvalEnv e b -> EvalEnv e c #

(*>) :: EvalEnv e a -> EvalEnv e b -> EvalEnv e b #

(<*) :: EvalEnv e a -> EvalEnv e b -> EvalEnv e a #

Monad e => FieldExp (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> EvalEnv e r -> EvalEnv e a Source #

Monad e => TupleExp (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

pair :: EvalEnv e a -> EvalEnv e b -> EvalEnv e (a, b) Source #

fstE :: EvalEnv e (a, b) -> EvalEnv e a Source #

sndE :: EvalEnv e (a, b) -> EvalEnv e b Source #

Monad e => ListExpFO (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

range :: Enum a => EvalEnv e a -> EvalEnv e a -> EvalEnv e [a] Source #

list :: DinoType a => [EvalEnv e a] -> EvalEnv e [a] Source #

headE :: EvalEnv e [a] -> EvalEnv e (Maybe a) Source #

append :: EvalEnv e [a] -> EvalEnv e [a] -> EvalEnv e [a] Source #

Monad e => CondExpFO (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Applicative e => CompareExp (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

eq :: Eq a => EvalEnv e a -> EvalEnv e a -> EvalEnv e Bool Source #

neq :: Eq a => EvalEnv e a -> EvalEnv e a -> EvalEnv e Bool Source #

lt :: Ord a => EvalEnv e a -> EvalEnv e a -> EvalEnv e Bool Source #

gt :: Ord a => EvalEnv e a -> EvalEnv e a -> EvalEnv e Bool Source #

lte :: Ord a => EvalEnv e a -> EvalEnv e a -> EvalEnv e Bool Source #

gte :: Ord a => EvalEnv e a -> EvalEnv e a -> EvalEnv e Bool Source #

min :: Ord a => EvalEnv e a -> EvalEnv e a -> EvalEnv e a Source #

max :: Ord a => EvalEnv e a -> EvalEnv e a -> EvalEnv e a Source #

Applicative e => LogicExp (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Applicative e => FracExp (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

fdiv :: (Fractional a, Eq a) => EvalEnv e a -> EvalEnv e a -> EvalEnv e a Source #

Applicative e => NumExp (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

add :: Num a => EvalEnv e a -> EvalEnv e a -> EvalEnv e a Source #

sub :: Num a => EvalEnv e a -> EvalEnv e a -> EvalEnv e a Source #

mul :: Num a => EvalEnv e a -> EvalEnv e a -> EvalEnv e a Source #

absE :: Num a => EvalEnv e a -> EvalEnv e a Source #

signE :: Num a => EvalEnv e a -> EvalEnv e a Source #

fromIntegral :: (Integral a, DinoType b, Num b) => EvalEnv e a -> EvalEnv e b Source #

floor :: (RealFrac a, DinoType b, Integral b) => EvalEnv e a -> EvalEnv e b Source #

truncate :: (RealFrac a, DinoType b, Integral b) => EvalEnv e a -> EvalEnv e b Source #

roundN :: RealFrac a => Int -> EvalEnv e a -> EvalEnv e a Source #

Applicative e => ConstExp (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

lit :: DinoType a => a -> EvalEnv e a Source #

Monad e => LetIntensional (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

letI :: DinoType a => Text -> EvalEnv e a -> EvalEnv e b -> EvalEnv e b Source #

Monad e => ListIntensional (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

mapI :: DinoType a => Text -> EvalEnv e b -> EvalEnv e [a] -> EvalEnv e [b] Source #

dropWhileI :: DinoType a => Text -> EvalEnv e Bool -> EvalEnv e [a] -> EvalEnv e [a] Source #

foldI :: (DinoType a, DinoType b) => Text -> Text -> EvalEnv e a -> EvalEnv e a -> EvalEnv e [b] -> EvalEnv e a Source #

Monad e => CondIntensional (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

maybeI :: DinoType a => Text -> EvalEnv e b -> EvalEnv e b -> EvalEnv e (Maybe a) -> EvalEnv e b Source #

Monad e => VarExp (EvalEnv e) Source #

Throws EvalEnvError when variable is not in scope or has the wrong type

Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> EvalEnv e a Source #

AnnExp ann (EvalEnv e :: Type -> Type) Source # 
Instance details

Defined in Dino.Interpretation

Methods

ann :: ann -> EvalEnv e a -> EvalEnv e a Source #

Monad e => MonadReader (HashMap Text Dinamic) (EvalEnv e) Source # 
Instance details

Defined in Dino.Interpretation

extendEnv Source #

Arguments

:: (Monad e, DinoType a) 
=> Text

Variable name

-> a

Value of variable

-> EvalEnv e b

Expression to evaluate in modified environment

-> EvalEnv e b 

Add a local variable binding

Checking assertions

newtype AssertViaMonadError e a Source #

Interpretation wrapper whose AssertExp instance uses MonadError

Constructors

AssertViaMonadError 

Fields

Instances
MonadError exc e => MonadError exc (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

Monad e => Monad (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

Functor e => Functor (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

fmap :: (a -> b) -> AssertViaMonadError e a -> AssertViaMonadError e b #

(<$) :: a -> AssertViaMonadError e b -> AssertViaMonadError e a #

Applicative e => Applicative (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

MonadError InvalidAssertion e => AssertExp (AssertViaMonadError e) Source #

Throws InvalidAssertion in the underlying monad

Instance details

Defined in Dino.Interpretation

FieldExp e => FieldExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> AssertViaMonadError e r -> AssertViaMonadError e a Source #

LetExp e => LetExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

TupleExp e => TupleExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

ListExp e => ListExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

ListExpFO e => ListExpFO (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

CondExp e => CondExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

CondExpFO e => CondExpFO (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

CompareExp e => CompareExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

LogicExp e => LogicExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

FracExp e => FracExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

NumExp e => NumExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

ConstExp e => ConstExp (AssertViaMonadError e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

lit :: DinoType a => a -> AssertViaMonadError e a Source #

AnnExp ann e => AnnExp ann (AssertViaMonadError e :: Type -> Type) Source # 
Instance details

Defined in Dino.Interpretation

Methods

ann :: ann -> AssertViaMonadError e a -> AssertViaMonadError e a Source #

newtype AssertViaMonadThrow e a Source #

Interpretation wrapper whose AssertExp instance uses MonadThrow

Constructors

AssertViaMonadThrow 

Fields

Instances
Monad e => Monad (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

Functor e => Functor (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

fmap :: (a -> b) -> AssertViaMonadThrow e a -> AssertViaMonadThrow e b #

(<$) :: a -> AssertViaMonadThrow e b -> AssertViaMonadThrow e a #

Applicative e => Applicative (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

MonadThrow e => MonadThrow (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

throwM :: Exception e0 => e0 -> AssertViaMonadThrow e a #

MonadThrow e => AssertExp (AssertViaMonadThrow e) Source #

Throws InvalidAssertion in the underlying monad

Instance details

Defined in Dino.Interpretation

FieldExp e => FieldExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> AssertViaMonadThrow e r -> AssertViaMonadThrow e a Source #

LetExp e => LetExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

TupleExp e => TupleExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

ListExp e => ListExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

ListExpFO e => ListExpFO (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

CondExp e => CondExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

CondExpFO e => CondExpFO (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

CompareExp e => CompareExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

LogicExp e => LogicExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

FracExp e => FracExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

NumExp e => NumExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

ConstExp e => ConstExp (AssertViaMonadThrow e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

lit :: DinoType a => a -> AssertViaMonadThrow e a Source #

AnnExp ann e => AnnExp ann (AssertViaMonadThrow e :: Type -> Type) Source # 
Instance details

Defined in Dino.Interpretation

Methods

ann :: ann -> AssertViaMonadThrow e a -> AssertViaMonadThrow e a Source #

data Assertion e where Source #

Constructors

Assert :: e Bool -> Assertion e 
AssertEq :: (Eq a, Show a) => e a -> e a -> Assertion e 

newtype CollectAssertions e a Source #

Collect all assertions in an expression

Note that the wrapped interpretation e must have instances of intensional classes in order for CollectAssertions to derive instances of HOS classes. In order for the wrapped interpretation to do monadic evaluation, use the wrapper EvalEnv to obtain the necessary intensional instances.

Instances
AssertExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

FieldExp e => FieldExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> CollectAssertions e r -> CollectAssertions e a Source #

(VarExp e, LetIntensional e) => LetExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

TupleExp e => TupleExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

(ListExpFO e, VarExp e, ListIntensional e) => ListExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

ListExpFO e => ListExpFO (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

(CondExpFO e, VarExp e, CondIntensional e) => CondExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

CondExpFO e => CondExpFO (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

CompareExp e => CompareExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

LogicExp e => LogicExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

FracExp e => FracExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

NumExp e => NumExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

ConstExp e => ConstExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

lit :: DinoType a => a -> CollectAssertions e a Source #

VarExp e => VarExp (CollectAssertions e) Source # 
Instance details

Defined in Dino.Interpretation

Methods

varE :: DinoType a => Text -> CollectAssertions e a Source #

AnnExp ann e => AnnExp ann (CollectAssertions e :: Type -> Type) Source # 
Instance details

Defined in Dino.Interpretation

Methods

ann :: ann -> CollectAssertions e a -> CollectAssertions e a Source #

Orphan instances

AssertExp Maybe Source #

Ignoring assertion for efficiency

Instance details

Methods

assert :: Text -> Maybe Bool -> Maybe a -> Maybe a Source #

assertEq :: (Eq a, Show a) => Text -> Maybe a -> Maybe a -> Maybe a Source #

AssertExp Identity Source #

Ignoring assertion for efficiency

Instance details

Methods

assert :: Text -> Identity Bool -> Identity a -> Identity a Source #

assertEq :: (Eq a, Show a) => Text -> Identity a -> Identity a -> Identity a Source #

AssertExp DinoTypeRep Source # 
Instance details

FieldExp Maybe Source # 
Instance details

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> Maybe r -> Maybe a Source #

FieldExp Identity Source # 
Instance details

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> Identity r -> Identity a Source #

FieldExp DinoTypeRep Source # 
Instance details

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> DinoTypeRep r -> DinoTypeRep a Source #

LetExp Maybe Source # 
Instance details

Methods

letE :: DinoType a => Text -> Maybe a -> (Maybe a -> Maybe b) -> Maybe b Source #

LetExp Identity Source # 
Instance details

Methods

letE :: DinoType a => Text -> Identity a -> (Identity a -> Identity b) -> Identity b Source #

LetExp DinoTypeRep Source # 
Instance details

Methods

letE :: DinoType a => Text -> DinoTypeRep a -> (DinoTypeRep a -> DinoTypeRep b) -> DinoTypeRep b Source #

TupleExp Maybe Source # 
Instance details

Methods

pair :: Maybe a -> Maybe b -> Maybe (a, b) Source #

fstE :: Maybe (a, b) -> Maybe a Source #

sndE :: Maybe (a, b) -> Maybe b Source #

TupleExp Identity Source # 
Instance details

Methods

pair :: Identity a -> Identity b -> Identity (a, b) Source #

fstE :: Identity (a, b) -> Identity a Source #

sndE :: Identity (a, b) -> Identity b Source #

TupleExp DinoTypeRep Source # 
Instance details

ListExp Maybe Source # 
Instance details

Methods

mapE :: DinoType a => (Maybe a -> Maybe b) -> Maybe [a] -> Maybe [b] Source #

dropWhileE :: DinoType a => (Maybe a -> Maybe Bool) -> Maybe [a] -> Maybe [a] Source #

foldE :: (DinoType a, DinoType b) => (Maybe a -> Maybe b -> Maybe a) -> Maybe a -> Maybe [b] -> Maybe a Source #

ListExp Identity Source # 
Instance details

Methods

mapE :: DinoType a => (Identity a -> Identity b) -> Identity [a] -> Identity [b] Source #

dropWhileE :: DinoType a => (Identity a -> Identity Bool) -> Identity [a] -> Identity [a] Source #

foldE :: (DinoType a, DinoType b) => (Identity a -> Identity b -> Identity a) -> Identity a -> Identity [b] -> Identity a Source #

ListExp DinoTypeRep Source # 
Instance details

ListExpFO Maybe Source # 
Instance details

Methods

range :: Enum a => Maybe a -> Maybe a -> Maybe [a] Source #

list :: DinoType a => [Maybe a] -> Maybe [a] Source #

headE :: Maybe [a] -> Maybe (Maybe a) Source #

append :: Maybe [a] -> Maybe [a] -> Maybe [a] Source #

ListExpFO Identity Source # 
Instance details

Methods

range :: Enum a => Identity a -> Identity a -> Identity [a] Source #

list :: DinoType a => [Identity a] -> Identity [a] Source #

headE :: Identity [a] -> Identity (Maybe a) Source #

append :: Identity [a] -> Identity [a] -> Identity [a] Source #

ListExpFO DinoTypeRep Source # 
Instance details

CondExp Maybe Source # 
Instance details

Methods

maybe :: DinoType a => Maybe b -> (Maybe a -> Maybe b) -> Maybe (Maybe a) -> Maybe b Source #

CondExp Identity Source # 
Instance details

Methods

maybe :: DinoType a => Identity b -> (Identity a -> Identity b) -> Identity (Maybe a) -> Identity b Source #

CondExp DinoTypeRep Source # 
Instance details

CondExpFO Maybe Source # 
Instance details

CondExpFO Identity Source # 
Instance details

CondExpFO DinoTypeRep Source # 
Instance details

CompareExp Maybe Source # 
Instance details

Methods

eq :: Eq a => Maybe a -> Maybe a -> Maybe Bool Source #

neq :: Eq a => Maybe a -> Maybe a -> Maybe Bool Source #

lt :: Ord a => Maybe a -> Maybe a -> Maybe Bool Source #

gt :: Ord a => Maybe a -> Maybe a -> Maybe Bool Source #

lte :: Ord a => Maybe a -> Maybe a -> Maybe Bool Source #

gte :: Ord a => Maybe a -> Maybe a -> Maybe Bool Source #

min :: Ord a => Maybe a -> Maybe a -> Maybe a Source #

max :: Ord a => Maybe a -> Maybe a -> Maybe a Source #

CompareExp Identity Source # 
Instance details

CompareExp DinoTypeRep Source # 
Instance details

LogicExp Maybe Source # 
Instance details

LogicExp Identity Source # 
Instance details

LogicExp DinoTypeRep Source # 
Instance details

FracExp Maybe Source # 
Instance details

Methods

fdiv :: (Fractional a, Eq a) => Maybe a -> Maybe a -> Maybe a Source #

FracExp Identity Source # 
Instance details

Methods

fdiv :: (Fractional a, Eq a) => Identity a -> Identity a -> Identity a Source #

FracExp DinoTypeRep Source # 
Instance details

Methods

fdiv :: (Fractional a, Eq a) => DinoTypeRep a -> DinoTypeRep a -> DinoTypeRep a Source #

NumExp Maybe Source # 
Instance details

Methods

add :: Num a => Maybe a -> Maybe a -> Maybe a Source #

sub :: Num a => Maybe a -> Maybe a -> Maybe a Source #

mul :: Num a => Maybe a -> Maybe a -> Maybe a Source #

absE :: Num a => Maybe a -> Maybe a Source #

signE :: Num a => Maybe a -> Maybe a Source #

fromIntegral :: (Integral a, DinoType b, Num b) => Maybe a -> Maybe b Source #

floor :: (RealFrac a, DinoType b, Integral b) => Maybe a -> Maybe b Source #

truncate :: (RealFrac a, DinoType b, Integral b) => Maybe a -> Maybe b Source #

roundN :: RealFrac a => Int -> Maybe a -> Maybe a Source #

NumExp Identity Source # 
Instance details

NumExp DinoTypeRep Source # 
Instance details

ConstExp Maybe Source # 
Instance details

Methods

lit :: DinoType a => a -> Maybe a Source #

ConstExp Identity Source # 
Instance details

Methods

lit :: DinoType a => a -> Identity a Source #

ConstExp DinoTypeRep Source # 
Instance details

Methods

lit :: DinoType a => a -> DinoTypeRep a Source #

AssertExp (Either e) Source #

Ignoring assertion for efficiency

Instance details

Methods

assert :: Text -> Either e Bool -> Either e a -> Either e a Source #

assertEq :: (Eq a, Show a) => Text -> Either e a -> Either e a -> Either e a Source #

FieldExp (Either e) Source # 
Instance details

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> Either e r -> Either e a Source #

LetExp (Either e) Source # 
Instance details

Methods

letE :: DinoType a => Text -> Either e a -> (Either e a -> Either e b) -> Either e b Source #

TupleExp (Either e) Source # 
Instance details

Methods

pair :: Either e a -> Either e b -> Either e (a, b) Source #

fstE :: Either e (a, b) -> Either e a Source #

sndE :: Either e (a, b) -> Either e b Source #

ListExp (Either e) Source # 
Instance details

Methods

mapE :: DinoType a => (Either e a -> Either e b) -> Either e [a] -> Either e [b] Source #

dropWhileE :: DinoType a => (Either e a -> Either e Bool) -> Either e [a] -> Either e [a] Source #

foldE :: (DinoType a, DinoType b) => (Either e a -> Either e b -> Either e a) -> Either e a -> Either e [b] -> Either e a Source #

ListExpFO (Either e) Source # 
Instance details

Methods

range :: Enum a => Either e a -> Either e a -> Either e [a] Source #

list :: DinoType a => [Either e a] -> Either e [a] Source #

headE :: Either e [a] -> Either e (Maybe a) Source #

append :: Either e [a] -> Either e [a] -> Either e [a] Source #

CondExp (Either e) Source # 
Instance details

Methods

maybe :: DinoType a => Either e b -> (Either e a -> Either e b) -> Either e (Maybe a) -> Either e b Source #

CondExpFO (Either e) Source # 
Instance details

Methods

just :: Either e a -> Either e (Maybe a) Source #

cases :: [Either e Bool :-> Either e a] -> (Otherwise :-> Either e a) -> Either e a Source #

partial_cases :: HasCallStack => [Either e Bool :-> Either e a] -> Either e a Source #

CompareExp (Either e) Source # 
Instance details

Methods

eq :: Eq a => Either e a -> Either e a -> Either e Bool Source #

neq :: Eq a => Either e a -> Either e a -> Either e Bool Source #

lt :: Ord a => Either e a -> Either e a -> Either e Bool Source #

gt :: Ord a => Either e a -> Either e a -> Either e Bool Source #

lte :: Ord a => Either e a -> Either e a -> Either e Bool Source #

gte :: Ord a => Either e a -> Either e a -> Either e Bool Source #

min :: Ord a => Either e a -> Either e a -> Either e a Source #

max :: Ord a => Either e a -> Either e a -> Either e a Source #

LogicExp (Either e) Source # 
Instance details

FracExp (Either e) Source # 
Instance details

Methods

fdiv :: (Fractional a, Eq a) => Either e a -> Either e a -> Either e a Source #

NumExp (Either e) Source # 
Instance details

Methods

add :: Num a => Either e a -> Either e a -> Either e a Source #

sub :: Num a => Either e a -> Either e a -> Either e a Source #

mul :: Num a => Either e a -> Either e a -> Either e a Source #

absE :: Num a => Either e a -> Either e a Source #

signE :: Num a => Either e a -> Either e a Source #

fromIntegral :: (Integral a, DinoType b, Num b) => Either e a -> Either e b Source #

floor :: (RealFrac a, DinoType b, Integral b) => Either e a -> Either e b Source #

truncate :: (RealFrac a, DinoType b, Integral b) => Either e a -> Either e b Source #

roundN :: RealFrac a => Int -> Either e a -> Either e a Source #

ConstExp (Either e) Source # 
Instance details

Methods

lit :: DinoType a => a -> Either e a Source #

AnnExp ann Maybe Source # 
Instance details

Methods

ann :: ann -> Maybe a -> Maybe a Source #

AnnExp ann Identity Source # 
Instance details

Methods

ann :: ann -> Identity a -> Identity a Source #

AnnExp ann DinoTypeRep Source # 
Instance details

Methods

ann :: ann -> DinoTypeRep a -> DinoTypeRep a Source #

AnnExp ann (Either e :: Type -> Type) Source # 
Instance details

Methods

ann :: ann -> Either e a -> Either e a Source #

AnnExp ann (WriterT t m :: Type -> Type) Source # 
Instance details

Methods

ann :: ann -> WriterT t m a -> WriterT t m a Source #

AnnExp ann (ExceptT e m :: Type -> Type) Source # 
Instance details

Methods

ann :: ann -> ExceptT e m a -> ExceptT e m a Source #

AnnExp ann (ReaderT env m :: Type -> Type) Source # 
Instance details

Methods

ann :: ann -> ReaderT env m a -> ReaderT env m a Source #

AssertExp (ExceptT e m) Source #

Ignoring assertion for efficiency

Instance details

Methods

assert :: Text -> ExceptT e m Bool -> ExceptT e m a -> ExceptT e m a Source #

assertEq :: (Eq a, Show a) => Text -> ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #

AssertExp (WriterT t m) Source #

Ignoring assertion for efficiency

Instance details

Methods

assert :: Text -> WriterT t m Bool -> WriterT t m a -> WriterT t m a Source #

assertEq :: (Eq a, Show a) => Text -> WriterT t m a -> WriterT t m a -> WriterT t m a Source #

Monad m => FieldExp (ExceptT e m) Source # 
Instance details

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> ExceptT e m r -> ExceptT e m a Source #

(Monoid t, Monad m) => FieldExp (WriterT t m) Source # 
Instance details

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> WriterT t m r -> WriterT t m a Source #

Monad m => LetExp (ExceptT e m) Source # 
Instance details

Methods

letE :: DinoType a => Text -> ExceptT e m a -> (ExceptT e m a -> ExceptT e m b) -> ExceptT e m b Source #

(Monoid t, Monad m) => LetExp (WriterT t m) Source # 
Instance details

Methods

letE :: DinoType a => Text -> WriterT t m a -> (WriterT t m a -> WriterT t m b) -> WriterT t m b Source #

Monad m => TupleExp (ExceptT e m) Source # 
Instance details

Methods

pair :: ExceptT e m a -> ExceptT e m b -> ExceptT e m (a, b) Source #

fstE :: ExceptT e m (a, b) -> ExceptT e m a Source #

sndE :: ExceptT e m (a, b) -> ExceptT e m b Source #

(Monoid t, Monad m) => TupleExp (WriterT t m) Source # 
Instance details

Methods

pair :: WriterT t m a -> WriterT t m b -> WriterT t m (a, b) Source #

fstE :: WriterT t m (a, b) -> WriterT t m a Source #

sndE :: WriterT t m (a, b) -> WriterT t m b Source #

Monad m => ListExp (ExceptT e m) Source # 
Instance details

Methods

mapE :: DinoType a => (ExceptT e m a -> ExceptT e m b) -> ExceptT e m [a] -> ExceptT e m [b] Source #

dropWhileE :: DinoType a => (ExceptT e m a -> ExceptT e m Bool) -> ExceptT e m [a] -> ExceptT e m [a] Source #

foldE :: (DinoType a, DinoType b) => (ExceptT e m a -> ExceptT e m b -> ExceptT e m a) -> ExceptT e m a -> ExceptT e m [b] -> ExceptT e m a Source #

(Monoid t, Monad m) => ListExp (WriterT t m) Source # 
Instance details

Methods

mapE :: DinoType a => (WriterT t m a -> WriterT t m b) -> WriterT t m [a] -> WriterT t m [b] Source #

dropWhileE :: DinoType a => (WriterT t m a -> WriterT t m Bool) -> WriterT t m [a] -> WriterT t m [a] Source #

foldE :: (DinoType a, DinoType b) => (WriterT t m a -> WriterT t m b -> WriterT t m a) -> WriterT t m a -> WriterT t m [b] -> WriterT t m a Source #

Monad m => ListExpFO (ExceptT e m) Source # 
Instance details

Methods

range :: Enum a => ExceptT e m a -> ExceptT e m a -> ExceptT e m [a] Source #

list :: DinoType a => [ExceptT e m a] -> ExceptT e m [a] Source #

headE :: ExceptT e m [a] -> ExceptT e m (Maybe a) Source #

append :: ExceptT e m [a] -> ExceptT e m [a] -> ExceptT e m [a] Source #

(Monoid t, Monad m) => ListExpFO (WriterT t m) Source # 
Instance details

Methods

range :: Enum a => WriterT t m a -> WriterT t m a -> WriterT t m [a] Source #

list :: DinoType a => [WriterT t m a] -> WriterT t m [a] Source #

headE :: WriterT t m [a] -> WriterT t m (Maybe a) Source #

append :: WriterT t m [a] -> WriterT t m [a] -> WriterT t m [a] Source #

Monad m => CondExp (ExceptT e m) Source # 
Instance details

Methods

maybe :: DinoType a => ExceptT e m b -> (ExceptT e m a -> ExceptT e m b) -> ExceptT e m (Maybe a) -> ExceptT e m b Source #

(Monoid t, Monad m) => CondExp (WriterT t m) Source # 
Instance details

Methods

maybe :: DinoType a => WriterT t m b -> (WriterT t m a -> WriterT t m b) -> WriterT t m (Maybe a) -> WriterT t m b Source #

Monad m => CondExpFO (ExceptT e m) Source # 
Instance details

Methods

just :: ExceptT e m a -> ExceptT e m (Maybe a) Source #

cases :: [ExceptT e m Bool :-> ExceptT e m a] -> (Otherwise :-> ExceptT e m a) -> ExceptT e m a Source #

partial_cases :: HasCallStack => [ExceptT e m Bool :-> ExceptT e m a] -> ExceptT e m a Source #

(Monoid t, Monad m) => CondExpFO (WriterT t m) Source # 
Instance details

Methods

just :: WriterT t m a -> WriterT t m (Maybe a) Source #

cases :: [WriterT t m Bool :-> WriterT t m a] -> (Otherwise :-> WriterT t m a) -> WriterT t m a Source #

partial_cases :: HasCallStack => [WriterT t m Bool :-> WriterT t m a] -> WriterT t m a Source #

Monad m => CompareExp (ExceptT e m) Source # 
Instance details

Methods

eq :: Eq a => ExceptT e m a -> ExceptT e m a -> ExceptT e m Bool Source #

neq :: Eq a => ExceptT e m a -> ExceptT e m a -> ExceptT e m Bool Source #

lt :: Ord a => ExceptT e m a -> ExceptT e m a -> ExceptT e m Bool Source #

gt :: Ord a => ExceptT e m a -> ExceptT e m a -> ExceptT e m Bool Source #

lte :: Ord a => ExceptT e m a -> ExceptT e m a -> ExceptT e m Bool Source #

gte :: Ord a => ExceptT e m a -> ExceptT e m a -> ExceptT e m Bool Source #

min :: Ord a => ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #

max :: Ord a => ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #

(Monoid t, Applicative m) => CompareExp (WriterT t m) Source # 
Instance details

Methods

eq :: Eq a => WriterT t m a -> WriterT t m a -> WriterT t m Bool Source #

neq :: Eq a => WriterT t m a -> WriterT t m a -> WriterT t m Bool Source #

lt :: Ord a => WriterT t m a -> WriterT t m a -> WriterT t m Bool Source #

gt :: Ord a => WriterT t m a -> WriterT t m a -> WriterT t m Bool Source #

lte :: Ord a => WriterT t m a -> WriterT t m a -> WriterT t m Bool Source #

gte :: Ord a => WriterT t m a -> WriterT t m a -> WriterT t m Bool Source #

min :: Ord a => WriterT t m a -> WriterT t m a -> WriterT t m a Source #

max :: Ord a => WriterT t m a -> WriterT t m a -> WriterT t m a Source #

Monad m => LogicExp (ExceptT e m) Source # 
Instance details

Methods

not :: ExceptT e m Bool -> ExceptT e m Bool Source #

conj :: ExceptT e m Bool -> ExceptT e m Bool -> ExceptT e m Bool Source #

disj :: ExceptT e m Bool -> ExceptT e m Bool -> ExceptT e m Bool Source #

xor :: ExceptT e m Bool -> ExceptT e m Bool -> ExceptT e m Bool Source #

(Monoid t, Applicative m) => LogicExp (WriterT t m) Source # 
Instance details

Methods

not :: WriterT t m Bool -> WriterT t m Bool Source #

conj :: WriterT t m Bool -> WriterT t m Bool -> WriterT t m Bool Source #

disj :: WriterT t m Bool -> WriterT t m Bool -> WriterT t m Bool Source #

xor :: WriterT t m Bool -> WriterT t m Bool -> WriterT t m Bool Source #

Monad m => FracExp (ExceptT e m) Source # 
Instance details

Methods

fdiv :: (Fractional a, Eq a) => ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #

(Monoid t, Applicative m) => FracExp (WriterT t m) Source # 
Instance details

Methods

fdiv :: (Fractional a, Eq a) => WriterT t m a -> WriterT t m a -> WriterT t m a Source #

Monad m => NumExp (ExceptT e m) Source # 
Instance details

Methods

add :: Num a => ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #

sub :: Num a => ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #

mul :: Num a => ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #

absE :: Num a => ExceptT e m a -> ExceptT e m a Source #

signE :: Num a => ExceptT e m a -> ExceptT e m a Source #

fromIntegral :: (Integral a, DinoType b, Num b) => ExceptT e m a -> ExceptT e m b Source #

floor :: (RealFrac a, DinoType b, Integral b) => ExceptT e m a -> ExceptT e m b Source #

truncate :: (RealFrac a, DinoType b, Integral b) => ExceptT e m a -> ExceptT e m b Source #

roundN :: RealFrac a => Int -> ExceptT e m a -> ExceptT e m a Source #

(Monoid t, Applicative m) => NumExp (WriterT t m) Source # 
Instance details

Methods

add :: Num a => WriterT t m a -> WriterT t m a -> WriterT t m a Source #

sub :: Num a => WriterT t m a -> WriterT t m a -> WriterT t m a Source #

mul :: Num a => WriterT t m a -> WriterT t m a -> WriterT t m a Source #

absE :: Num a => WriterT t m a -> WriterT t m a Source #

signE :: Num a => WriterT t m a -> WriterT t m a Source #

fromIntegral :: (Integral a, DinoType b, Num b) => WriterT t m a -> WriterT t m b Source #

floor :: (RealFrac a, DinoType b, Integral b) => WriterT t m a -> WriterT t m b Source #

truncate :: (RealFrac a, DinoType b, Integral b) => WriterT t m a -> WriterT t m b Source #

roundN :: RealFrac a => Int -> WriterT t m a -> WriterT t m a Source #

Monad m => ConstExp (ExceptT e m) Source # 
Instance details

Methods

lit :: DinoType a => a -> ExceptT e m a Source #

(Monoid t, Applicative m) => ConstExp (WriterT t m) Source # 
Instance details

Methods

lit :: DinoType a => a -> WriterT t m a Source #

AssertExp (ReaderT env m) Source #

Ignoring assertion for efficiency

Instance details

Methods

assert :: Text -> ReaderT env m Bool -> ReaderT env m a -> ReaderT env m a Source #

assertEq :: (Eq a, Show a) => Text -> ReaderT env m a -> ReaderT env m a -> ReaderT env m a Source #

Monad m => FieldExp (ReaderT env m) Source # 
Instance details

Methods

getField :: (KnownSymbol f, HasField f r a, DinoType a) => proxy f -> ReaderT env m r -> ReaderT env m a Source #

Monad m => LetExp (ReaderT env m) Source # 
Instance details

Methods

letE :: DinoType a => Text -> ReaderT env m a -> (ReaderT env m a -> ReaderT env m b) -> ReaderT env m b Source #

Monad m => TupleExp (ReaderT env m) Source # 
Instance details

Methods

pair :: ReaderT env m a -> ReaderT env m b -> ReaderT env m (a, b) Source #

fstE :: ReaderT env m (a, b) -> ReaderT env m a Source #

sndE :: ReaderT env m (a, b) -> ReaderT env m b Source #

Monad m => ListExp (ReaderT env m) Source # 
Instance details

Methods

mapE :: DinoType a => (ReaderT env m a -> ReaderT env m b) -> ReaderT env m [a] -> ReaderT env m [b] Source #

dropWhileE :: DinoType a => (ReaderT env m a -> ReaderT env m Bool) -> ReaderT env m [a] -> ReaderT env m [a] Source #

foldE :: (DinoType a, DinoType b) => (ReaderT env m a -> ReaderT env m b -> ReaderT env m a) -> ReaderT env m a -> ReaderT env m [b] -> ReaderT env m a Source #

Monad m => ListExpFO (ReaderT env m) Source # 
Instance details

Methods

range :: Enum a => ReaderT env m a -> ReaderT env m a -> ReaderT env m [a] Source #

list :: DinoType a => [ReaderT env m a] -> ReaderT env m [a] Source #

headE :: ReaderT env m [a] -> ReaderT env m (Maybe a) Source #

append :: ReaderT env m [a] -> ReaderT env m [a] -> ReaderT env m [a] Source #

Monad m => CondExp (ReaderT env m) Source # 
Instance details

Methods

maybe :: DinoType a => ReaderT env m b -> (ReaderT env m a -> ReaderT env m b) -> ReaderT env m (Maybe a) -> ReaderT env m b Source #

Monad m => CondExpFO (ReaderT env m) Source # 
Instance details

Methods

just :: ReaderT env m a -> ReaderT env m (Maybe a) Source #

cases :: [ReaderT env m Bool :-> ReaderT env m a] -> (Otherwise :-> ReaderT env m a) -> ReaderT env m a Source #

partial_cases :: HasCallStack => [ReaderT env m Bool :-> ReaderT env m a] -> ReaderT env m a Source #

Applicative m => CompareExp (ReaderT env m) Source # 
Instance details

Methods

eq :: Eq a => ReaderT env m a -> ReaderT env m a -> ReaderT env m Bool Source #

neq :: Eq a => ReaderT env m a -> ReaderT env m a -> ReaderT env m Bool Source #

lt :: Ord a => ReaderT env m a -> ReaderT env m a -> ReaderT env m Bool Source #

gt :: Ord a => ReaderT env m a -> ReaderT env m a -> ReaderT env m Bool Source #

lte :: Ord a => ReaderT env m a -> ReaderT env m a -> ReaderT env m Bool Source #

gte :: Ord a => ReaderT env m a -> ReaderT env m a -> ReaderT env m Bool Source #

min :: Ord a => ReaderT env m a -> ReaderT env m a -> ReaderT env m a Source #

max :: Ord a => ReaderT env m a -> ReaderT env m a -> ReaderT env m a Source #

Applicative m => LogicExp (ReaderT env m) Source # 
Instance details

Methods

not :: ReaderT env m Bool -> ReaderT env m Bool Source #

conj :: ReaderT env m Bool -> ReaderT env m Bool -> ReaderT env m Bool Source #

disj :: ReaderT env m Bool -> ReaderT env m Bool -> ReaderT env m Bool Source #

xor :: ReaderT env m Bool -> ReaderT env m Bool -> ReaderT env m Bool Source #

Applicative m => FracExp (ReaderT env m) Source # 
Instance details

Methods

fdiv :: (Fractional a, Eq a) => ReaderT env m a -> ReaderT env m a -> ReaderT env m a Source #

Applicative m => NumExp (ReaderT env m) Source # 
Instance details

Methods

add :: Num a => ReaderT env m a -> ReaderT env m a -> ReaderT env m a Source #

sub :: Num a => ReaderT env m a -> ReaderT env m a -> ReaderT env m a Source #

mul :: Num a => ReaderT env m a -> ReaderT env m a -> ReaderT env m a Source #

absE :: Num a => ReaderT env m a -> ReaderT env m a Source #

signE :: Num a => ReaderT env m a -> ReaderT env m a Source #

fromIntegral :: (Integral a, DinoType b, Num b) => ReaderT env m a -> ReaderT env m b Source #

floor :: (RealFrac a, DinoType b, Integral b) => ReaderT env m a -> ReaderT env m b Source #

truncate :: (RealFrac a, DinoType b, Integral b) => ReaderT env m a -> ReaderT env m b Source #

roundN :: RealFrac a => Int -> ReaderT env m a -> ReaderT env m a Source #

Applicative m => ConstExp (ReaderT env m) Source # 
Instance details

Methods

lit :: DinoType a => a -> ReaderT env m a Source #