ermine-0.6: Ermine

Copyright(c) Edward Kmett and Dan Doel 2014
LicenseBSD3
MaintainerDan Doel <dan.doel@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Ermine.Interpreter

Description

 

Documentation

data Address m Source

Instances

Eq (Address m) 

closureCode :: forall m. Traversal' (Closure m) LambdaForm Source

closureEnv :: forall m. Traversal' (Closure m) (Env m) Source

papArity :: forall m. Traversal' (Closure m) (Sorted Int) Source

allocPrimOp :: (Functor m, PrimMonad m) => (MachineState m -> m ()) -> m (Address m) Source

allocGlobal :: (Eq c, Functor m, PrimMonad m) => (c -> SortRef) -> Core Convention c -> m (Address m) Source

data Env m Source

Constructors

Env 

Fields

_envB :: Vector (Address m)
 
_envU :: Vector Word64
 
_envN :: Vector Native
 

Instances

Default (Env m) 

data Frame m Source

Constructors

Branch !Continuation !(Env m) 
Update !(Address m) 

data MachineState m Source

Constructors

MachineState 

Fields

_sp :: !(Sorted Int)
 
_fp :: !(Sorted Int)
 
_stackF :: [(Sorted Int, Frame m)]
 
_genv :: HashMap Id (Address m)
 
_trace :: String -> m ()
 
_stackB :: MVector (PrimState m) (Address m)
 
_stackU :: MVector (PrimState m) Word64
 
_stackN :: MVector (PrimState m) Native
 

trace :: forall m. Lens' (MachineState m) (String -> m ()) Source

eval :: (Applicative m, PrimMonad m) => G -> Env m -> MachineState m -> m () Source

defaultMachineState :: (Applicative m, PrimMonad m) => Int -> HashMap Id (Address m) -> m (MachineState m) Source

primOpNZ :: PrimMonad m => (a -> m ()) -> MachineState m -> m () Source

primOpNN :: (Applicative m, PrimMonad m) => (a -> m b) -> MachineState m -> m () Source

primOpUN :: (Applicative m, PrimMonad m) => (Word64 -> m b) -> MachineState m -> m () Source

primOpNU :: (Applicative m, PrimMonad m) => (a -> m Word64) -> MachineState m -> m () Source

primOpNNN :: (Applicative m, PrimMonad m) => (a -> b -> m c) -> MachineState m -> m () Source

primOpUUU :: (Applicative m, PrimMonad m) => (Word64 -> Word64 -> Word64) -> MachineState m -> m () Source