futhark-0.15.7: An optimising compiler for a functional, array-oriented language.
Safe HaskellNone
LanguageHaskell2010

Language.Futhark.Interpreter

Synopsis

Documentation

data Ctx Source #

Constructors

Ctx 

data Env Source #

Instances

Instances details
Semigroup Env Source # 
Instance details

Defined in Language.Futhark.Interpreter

Methods

(<>) :: Env -> Env -> Env #

sconcat :: NonEmpty Env -> Env #

stimes :: Integral b => b -> Env -> Env #

Monoid Env Source # 
Instance details

Defined in Language.Futhark.Interpreter

Methods

mempty :: Env #

mappend :: Env -> Env -> Env #

mconcat :: [Env] -> Env #

initialCtx :: Ctx Source #

The initial environment contains definitions of the various intrinsic functions.

interpretFunction :: Ctx -> VName -> [Value] -> Either String (F ExtOp Value) Source #

Execute the named function on the given arguments; may fail horribly if these are ill-typed.

data ExtOp a Source #

Instances

Instances details
Functor ExtOp Source # 
Instance details

Defined in Language.Futhark.Interpreter

Methods

fmap :: (a -> b) -> ExtOp a -> ExtOp b #

(<$) :: a -> ExtOp b -> ExtOp a #

data StackFrame Source #

Constructors

StackFrame 

Instances

Instances details
Located StackFrame Source # 
Instance details

Defined in Language.Futhark.Interpreter

data Value Source #

A fully evaluated Futhark value.

Instances

Instances details
Eq Value Source # 
Instance details

Defined in Language.Futhark.Interpreter

Methods

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

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

Pretty Value Source # 
Instance details

Defined in Language.Futhark.Interpreter

Methods

ppr :: Value -> Doc #

pprPrec :: Int -> Value -> Doc #

pprList :: [Value] -> Doc #

isEmptyArray :: Value -> Bool Source #

Does the value correspond to an empty array?

prettyEmptyArray :: TypeBase () () -> Value -> String Source #

String representation of an empty array with the provided element type. This is pretty ad-hoc - don't expect good results unless the element type is a primitive.