colorless-2.2.16: Colorless | The Programmatic IDL

Safe HaskellNone
LanguageHaskell2010

Colorless.Server.Expr

Documentation

data Expr m Source #

Instances

Eq (Expr m) Source # 

Methods

(==) :: Expr m -> Expr m -> Bool #

(/=) :: Expr m -> Expr m -> Bool #

Show (Expr m) Source # 

Methods

showsPrec :: Int -> Expr m -> ShowS #

show :: Expr m -> String #

showList :: [Expr m] -> ShowS #

data EvalConfig m Source #

Constructors

EvalConfig Options (ApiCall -> m Val) 

data Ref Source #

Constructors

Ref Symbol 

Instances

Eq Ref Source # 

Methods

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

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

Show Ref Source # 

Methods

showsPrec :: Int -> Ref -> ShowS #

show :: Ref -> String #

showList :: [Ref] -> ShowS #

data UnVal m Source #

Instances

Eq (UnVal m) Source # 

Methods

(==) :: UnVal m -> UnVal m -> Bool #

(/=) :: UnVal m -> UnVal m -> Bool #

Show (UnVal m) Source # 

Methods

showsPrec :: Int -> UnVal m -> ShowS #

show :: UnVal m -> String #

showList :: [UnVal m] -> ShowS #

data UnWrap m Source #

Constructors

UnWrap (Expr m) 

Instances

Eq (UnWrap m) Source # 

Methods

(==) :: UnWrap m -> UnWrap m -> Bool #

(/=) :: UnWrap m -> UnWrap m -> Bool #

Show (UnWrap m) Source # 

Methods

showsPrec :: Int -> UnWrap m -> ShowS #

show :: UnWrap m -> String #

showList :: [UnWrap m] -> ShowS #

data UnStruct m Source #

Constructors

UnStruct (Map MemberName (Expr m)) 

Instances

Eq (UnStruct m) Source # 

Methods

(==) :: UnStruct m -> UnStruct m -> Bool #

(/=) :: UnStruct m -> UnStruct m -> Bool #

Show (UnStruct m) Source # 

Methods

showsPrec :: Int -> UnStruct m -> ShowS #

show :: UnStruct m -> String #

showList :: [UnStruct m] -> ShowS #

data If m Source #

Constructors

If (Expr m) (Expr m) (Expr m) 

Instances

Eq (If m) Source # 

Methods

(==) :: If m -> If m -> Bool #

(/=) :: If m -> If m -> Bool #

Show (If m) Source # 

Methods

showsPrec :: Int -> If m -> ShowS #

show :: If m -> String #

showList :: [If m] -> ShowS #

data Get m Source #

Constructors

Get [Text] (Expr m) 

Instances

Eq (Get m) Source # 

Methods

(==) :: Get m -> Get m -> Bool #

(/=) :: Get m -> Get m -> Bool #

Show (Get m) Source # 

Methods

showsPrec :: Int -> Get m -> ShowS #

show :: Get m -> String #

showList :: [Get m] -> ShowS #

data Define m Source #

Constructors

Define Symbol (Expr m) 

Instances

Eq (Define m) Source # 

Methods

(==) :: Define m -> Define m -> Bool #

(/=) :: Define m -> Define m -> Bool #

Show (Define m) Source # 

Methods

showsPrec :: Int -> Define m -> ShowS #

show :: Define m -> String #

showList :: [Define m] -> ShowS #

data Lambda m Source #

Constructors

Lambda [(Symbol, Type)] (Expr m) 

Instances

Eq (Lambda m) Source # 

Methods

(==) :: Lambda m -> Lambda m -> Bool #

(/=) :: Lambda m -> Lambda m -> Bool #

Show (Lambda m) Source # 

Methods

showsPrec :: Int -> Lambda m -> ShowS #

show :: Lambda m -> String #

showList :: [Lambda m] -> ShowS #

newtype Fn m Source #

Constructors

Fn ([Expr m] -> Eval m (Expr m)) 

Instances

Eq (Fn m) Source # 

Methods

(==) :: Fn m -> Fn m -> Bool #

(/=) :: Fn m -> Fn m -> Bool #

Show (Fn m) Source # 

Methods

showsPrec :: Int -> Fn m -> ShowS #

show :: Fn m -> String #

showList :: [Fn m] -> ShowS #

data List m Source #

Constructors

List [Expr m] 

Instances

Eq (List m) Source # 

Methods

(==) :: List m -> List m -> Bool #

(/=) :: List m -> List m -> Bool #

Show (List m) Source # 

Methods

showsPrec :: Int -> List m -> ShowS #

show :: List m -> String #

showList :: [List m] -> ShowS #

data Do m Source #

Constructors

Do [Expr m] 

Instances

Eq (Do m) Source # 

Methods

(==) :: Do m -> Do m -> Bool #

(/=) :: Do m -> Do m -> Bool #

Show (Do m) Source # 

Methods

showsPrec :: Int -> Do m -> ShowS #

show :: Do m -> String #

showList :: [Do m] -> ShowS #

data FnCall m Source #

Constructors

FnCall (Expr m) [Expr m] 

Instances

Eq (FnCall m) Source # 

Methods

(==) :: FnCall m -> FnCall m -> Bool #

(/=) :: FnCall m -> FnCall m -> Bool #

Show (FnCall m) Source # 

Methods

showsPrec :: Int -> FnCall m -> ShowS #

show :: FnCall m -> String #

showList :: [FnCall m] -> ShowS #

data WrapUnCall m Source #

Constructors

WrapUnCall TypeName (Expr m) 

Instances

data Wrap Source #

Constructors

Wrap Const 

Instances

Eq Wrap Source # 

Methods

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

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

Show Wrap Source # 

Methods

showsPrec :: Int -> Wrap -> ShowS #

show :: Wrap -> String #

showList :: [Wrap] -> ShowS #

data Struct Source #

Constructors

Struct (Map MemberName Val) 

Instances

Eq Struct Source # 

Methods

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

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

Show Struct Source # 
Generic Struct Source # 

Associated Types

type Rep Struct :: * -> * #

Methods

from :: Struct -> Rep Struct x #

to :: Rep Struct x -> Struct #

ToJSON Struct Source # 
FromJSON Struct Source # 
type Rep Struct Source # 
type Rep Struct = D1 (MetaData "Struct" "Colorless.Val" "colorless-2.2.16-4TPpW4DwMJJ2GMQSLRIlJo" False) (C1 (MetaCons "Struct" PrefixI True) (S1 (MetaSel (Just Symbol "m") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map MemberName Val))))

fromAst :: Monad m => Ast -> Expr m Source #

data ApiParser api Source #

Constructors

ApiParser (Map TypeName api) (Map TypeName (Val -> Maybe api)) (Map TypeName (Val -> Maybe api)) (Map TypeName (Val -> Maybe api)) 

eval :: (MonadIO m, RuntimeThrower m) => Expr m -> IORef (Env m) -> Eval m (Expr m) Source #

forceVal :: RuntimeThrower m => Expr m -> Eval m Val Source #

runEval :: MonadIO m => Eval m a -> EvalConfig m -> m a Source #