Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Ref a
- data RefCMD fs a where
- NewRef :: pred a => String -> RefCMD (Param3 prog exp pred) (Ref a)
- InitRef :: pred a => String -> exp a -> RefCMD (Param3 prog exp pred) (Ref a)
- GetRef :: pred a => Ref a -> RefCMD (Param3 prog exp pred) (Val a)
- SetRef :: pred a => Ref a -> exp a -> RefCMD (Param3 prog exp pred) ()
- UnsafeFreezeRef :: pred a => Ref a -> RefCMD (Param3 prog exp pred) (Val a)
- data Arr i a
- data IArr i a
- data ArrCMD fs a where
- NewArr :: (pred a, Integral i, Ix i) => String -> exp i -> ArrCMD (Param3 prog exp pred) (Arr i a)
- InitArr :: (pred a, Integral i, Ix i) => String -> [a] -> ArrCMD (Param3 prog exp pred) (Arr i a)
- GetArr :: (pred a, Integral i, Ix i) => exp i -> Arr i a -> ArrCMD (Param3 prog exp pred) (Val a)
- SetArr :: (pred a, Integral i, Ix i) => exp i -> exp a -> Arr i a -> ArrCMD (Param3 prog exp pred) ()
- CopyArr :: (pred a, Integral i, Ix i) => Arr i a -> Arr i a -> exp i -> ArrCMD (Param3 prog exp pred) ()
- UnsafeFreezeArr :: (pred a, Integral i, Ix i) => Arr i a -> ArrCMD (Param3 prog exp pred) (IArr i a)
- UnsafeThawArr :: (pred a, Integral i, Ix i) => IArr i a -> ArrCMD (Param3 prog exp pred) (Arr i a)
- data Border i
- borderVal :: Border i -> i
- borderIncl :: Border i -> Bool
- type IxRange i = (i, Int, Border i)
- data ControlCMD fs a where
- If :: exp Bool -> prog () -> prog () -> ControlCMD (Param3 prog exp pred) ()
- While :: prog (exp Bool) -> prog () -> ControlCMD (Param3 prog exp pred) ()
- For :: (pred i, Integral i) => IxRange (exp i) -> (Val i -> prog ()) -> ControlCMD (Param3 prog exp pred) ()
- Break :: ControlCMD (Param3 prog exp pred) ()
- Assert :: exp Bool -> String -> ControlCMD (Param3 prog exp pred) ()
- class ToIdent a => IsPointer a where
- runSwapPtr :: a -> a -> IO ()
- data PtrCMD fs a where
- data Handle
- stdin :: Handle
- stdout :: Handle
- data PrintfArg exp where
- mapPrintfArg :: (forall a. exp1 a -> exp2 a) -> PrintfArg exp1 -> PrintfArg exp2
- mapPrintfArgM :: Monad m => (forall a. exp1 a -> m (exp2 a)) -> PrintfArg exp1 -> m (PrintfArg exp2)
- class (Typeable a, Read a, PrintfArg a) => Formattable a where
- formatSpecifier :: Proxy a -> String
- data FileCMD fs a where
- FOpen :: FilePath -> IOMode -> FileCMD (Param3 prog exp pred) Handle
- FClose :: Handle -> FileCMD (Param3 prog exp pred) ()
- FEof :: Handle -> FileCMD (Param3 prog exp pred) (Val Bool)
- FPrintf :: Handle -> String -> [PrintfArg exp] -> FileCMD (Param3 prog exp pred) ()
- FGet :: (pred a, Formattable a) => Handle -> FileCMD (Param3 prog exp pred) (Val a)
- newtype Ptr a = PtrComp {}
- data Object = Object {}
- class Arg arg pred where
- data FunArg exp pred where
- mapFunArg :: (forall a. exp1 a -> exp2 a) -> FunArg exp1 pred -> FunArg exp2 pred
- mapFunArgM :: Monad m => (forall a. exp1 a -> m (exp2 a)) -> FunArg exp1 pred -> m (FunArg exp2 pred)
- class ToIdent obj => Assignable obj
- data C_CMD fs a where
- NewPtr :: pred a => String -> C_CMD (Param3 prog exp pred) (Ptr a)
- PtrToArr :: Ptr a -> C_CMD (Param3 prog exp pred) (Arr i a)
- NewObject :: String -> String -> Bool -> C_CMD (Param3 prog exp pred) Object
- AddInclude :: String -> C_CMD (Param3 prog exp pred) ()
- AddDefinition :: Definition -> C_CMD (Param3 prog exp pred) ()
- AddExternFun :: pred res => String -> proxy res -> [FunArg exp pred] -> C_CMD (Param3 prog exp pred) ()
- AddExternProc :: String -> [FunArg exp pred] -> C_CMD (Param3 prog exp pred) ()
- CallFun :: pred a => String -> [FunArg exp pred] -> C_CMD (Param3 prog exp pred) (Val a)
- CallProc :: Assignable obj => Maybe obj -> String -> [FunArg exp pred] -> C_CMD (Param3 prog exp pred) ()
- InModule :: String -> prog () -> C_CMD (Param3 prog exp pred) ()
References
Mutable reference
Commands for mutable references
NewRef :: pred a => String -> RefCMD (Param3 prog exp pred) (Ref a) | |
InitRef :: pred a => String -> exp a -> RefCMD (Param3 prog exp pred) (Ref a) | |
GetRef :: pred a => Ref a -> RefCMD (Param3 prog exp pred) (Val a) | |
SetRef :: pred a => Ref a -> exp a -> RefCMD (Param3 prog exp pred) () | |
UnsafeFreezeRef :: pred a => Ref a -> RefCMD (Param3 prog exp pred) (Val a) |
HFunctor k * ((,) (* -> *) ((,) (* -> Constraint) *)) (RefCMD (k -> *)) Source | |
HBifunctor * * ((,) (* -> Constraint) *) (RefCMD (* -> *)) Source | |
(:<:) ((,) (* -> *) ((,) (* -> *) ((,) (* -> Constraint) *))) * (RefCMD (* -> *)) instr => Reexpressible * ((,) (* -> Constraint) *) (RefCMD (* -> *)) instr Source | |
InterpBi ((,) (* -> Constraint) *) * (RefCMD (* -> *)) IO (Param1 (* -> Constraint) pred) Source | |
DryInterp ((,) (* -> *) ((,) (* -> Constraint) *)) (RefCMD (* -> *)) Source |
Arrays
Mutable array
Immutable array
Commands for mutable arrays
NewArr :: (pred a, Integral i, Ix i) => String -> exp i -> ArrCMD (Param3 prog exp pred) (Arr i a) | |
InitArr :: (pred a, Integral i, Ix i) => String -> [a] -> ArrCMD (Param3 prog exp pred) (Arr i a) | |
GetArr :: (pred a, Integral i, Ix i) => exp i -> Arr i a -> ArrCMD (Param3 prog exp pred) (Val a) | |
SetArr :: (pred a, Integral i, Ix i) => exp i -> exp a -> Arr i a -> ArrCMD (Param3 prog exp pred) () | |
CopyArr :: (pred a, Integral i, Ix i) => Arr i a -> Arr i a -> exp i -> ArrCMD (Param3 prog exp pred) () | |
UnsafeFreezeArr :: (pred a, Integral i, Ix i) => Arr i a -> ArrCMD (Param3 prog exp pred) (IArr i a) | |
UnsafeThawArr :: (pred a, Integral i, Ix i) => IArr i a -> ArrCMD (Param3 prog exp pred) (Arr i a) |
HFunctor k * ((,) (* -> *) ((,) (* -> Constraint) *)) (ArrCMD (k -> *)) Source | |
HBifunctor * * ((,) (* -> Constraint) *) (ArrCMD (* -> *)) Source | |
(:<:) ((,) (* -> *) ((,) (* -> *) ((,) (* -> Constraint) *))) * (ArrCMD (* -> *)) instr => Reexpressible * ((,) (* -> Constraint) *) (ArrCMD (* -> *)) instr Source | |
InterpBi ((,) (* -> Constraint) *) * (ArrCMD (* -> *)) IO (Param1 (* -> Constraint) pred) Source | |
DryInterp ((,) (* -> *) ((,) (* -> Constraint) *)) (ArrCMD (* -> *)) Source |
Control flow
borderIncl :: Border i -> Bool Source
type IxRange i = (i, Int, Border i) Source
Index range
(lo,step,hi)
lo
gives the start index; step
gives the step length; hi
gives the stop
index which may be inclusive or exclusive.
data ControlCMD fs a where Source
If :: exp Bool -> prog () -> prog () -> ControlCMD (Param3 prog exp pred) () | |
While :: prog (exp Bool) -> prog () -> ControlCMD (Param3 prog exp pred) () | |
For :: (pred i, Integral i) => IxRange (exp i) -> (Val i -> prog ()) -> ControlCMD (Param3 prog exp pred) () | |
Break :: ControlCMD (Param3 prog exp pred) () | |
Assert :: exp Bool -> String -> ControlCMD (Param3 prog exp pred) () |
HFunctor * * ((,) (* -> *) ((,) (* -> Constraint) *)) ControlCMD Source | |
HBifunctor * * ((,) (* -> Constraint) *) ControlCMD Source | |
(:<:) ((,) (* -> *) ((,) (* -> *) ((,) (* -> Constraint) *))) * ControlCMD instr => Reexpressible * ((,) (* -> Constraint) *) ControlCMD instr Source | |
DryInterp ((,) (* -> *) ((,) (* -> Constraint) *)) ControlCMD Source | |
InterpBi ((,) (* -> Constraint) *) * ControlCMD IO (Param1 (* -> Constraint) pred) Source |
Pointers
class ToIdent a => IsPointer a where Source
Types that are represented as a pointers in C
runSwapPtr :: a -> a -> IO () Source
HFunctor k * ((,) k ((,) k *)) (PtrCMD (k -> *) k k) Source | |
HBifunctor * k ((,) k *) (PtrCMD (* -> *) (k -> *) k) Source | |
(:<:) ((,) (* -> *) ((,) (k -> *) ((,) k1 *))) * (PtrCMD (* -> *) (k -> *) k1) instr => Reexpressible k ((,) k *) (PtrCMD (* -> *) (k -> *) k) instr Source | |
InterpBi ((,) k *) * (PtrCMD (* -> *) (* -> *) k) IO (Param1 k pred) Source | |
DryInterp ((,) k ((,) k *)) (PtrCMD (* -> *) k k) Source |
File handling
mapPrintfArg :: (forall a. exp1 a -> exp2 a) -> PrintfArg exp1 -> PrintfArg exp2 Source
mapPrintfArgM :: Monad m => (forall a. exp1 a -> m (exp2 a)) -> PrintfArg exp1 -> m (PrintfArg exp2) Source
class (Typeable a, Read a, PrintfArg a) => Formattable a where Source
Values that can be printed/scanned using printf
/scanf
formatSpecifier :: Proxy a -> String Source
data FileCMD fs a where Source
FOpen :: FilePath -> IOMode -> FileCMD (Param3 prog exp pred) Handle | |
FClose :: Handle -> FileCMD (Param3 prog exp pred) () | |
FEof :: Handle -> FileCMD (Param3 prog exp pred) (Val Bool) | |
FPrintf :: Handle -> String -> [PrintfArg exp] -> FileCMD (Param3 prog exp pred) () | |
FGet :: (pred a, Formattable a) => Handle -> FileCMD (Param3 prog exp pred) (Val a) |
HFunctor k * ((,) (* -> *) ((,) (* -> Constraint) *)) (FileCMD (k -> *)) Source | |
HBifunctor * * ((,) (* -> Constraint) *) (FileCMD (* -> *)) Source | |
(:<:) ((,) (* -> *) ((,) (* -> *) ((,) (* -> Constraint) *))) * (FileCMD (* -> *)) instr => Reexpressible * ((,) (* -> Constraint) *) (FileCMD (* -> *)) instr Source | |
InterpBi ((,) (* -> Constraint) *) * (FileCMD (* -> *)) IO (Param1 (* -> Constraint) pred) Source | |
DryInterp ((,) (* -> *) ((,) (* -> Constraint) *)) (FileCMD (* -> *)) Source |
C-specific commands
Abstract object
mapFunArgM :: Monad m => (forall a. exp1 a -> m (exp2 a)) -> FunArg exp1 pred -> m (FunArg exp2 pred) Source
class ToIdent obj => Assignable obj Source
Assignable Object Source | |
Assignable (Ptr a) Source | |
Assignable (Ref a) Source | |
Assignable (IArr i a) Source | |
Assignable (Arr i a) Source |
NewPtr :: pred a => String -> C_CMD (Param3 prog exp pred) (Ptr a) | |
PtrToArr :: Ptr a -> C_CMD (Param3 prog exp pred) (Arr i a) | |
NewObject :: String -> String -> Bool -> C_CMD (Param3 prog exp pred) Object | |
AddInclude :: String -> C_CMD (Param3 prog exp pred) () | |
AddDefinition :: Definition -> C_CMD (Param3 prog exp pred) () | |
AddExternFun :: pred res => String -> proxy res -> [FunArg exp pred] -> C_CMD (Param3 prog exp pred) () | |
AddExternProc :: String -> [FunArg exp pred] -> C_CMD (Param3 prog exp pred) () | |
CallFun :: pred a => String -> [FunArg exp pred] -> C_CMD (Param3 prog exp pred) (Val a) | |
CallProc :: Assignable obj => Maybe obj -> String -> [FunArg exp pred] -> C_CMD (Param3 prog exp pred) () | |
InModule :: String -> prog () -> C_CMD (Param3 prog exp pred) () |
HFunctor * * ((,) (* -> *) ((,) (* -> Constraint) *)) C_CMD Source | |
HBifunctor * * ((,) (* -> Constraint) *) C_CMD Source | |
(:<:) ((,) (* -> *) ((,) (* -> *) ((,) (* -> Constraint) *))) * C_CMD instr => Reexpressible * ((,) (* -> Constraint) *) C_CMD instr Source | |
DryInterp ((,) (* -> *) ((,) (* -> Constraint) *)) C_CMD Source | |
InterpBi ((,) (* -> Constraint) *) * C_CMD IO (Param1 (* -> Constraint) pred) Source |