imperative-edsl-0.8.2: Deep embedding of imperative programs with code generation
Safe HaskellNone
LanguageHaskell2010

Language.Embedded.Imperative.Frontend.General

Description

Exports the general parts of imperative front ends. The motivation for this module is to support making specialized front ends (e.g. like Language.Embedded.Imperative.Frontend but for a specific instruction set). These exports are the parts of the front end that are independent of the instruction set and/or expression language.

Synopsis

Documentation

data Ref a Source #

Mutable reference

Instances

Instances details
Eq (Ref a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

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

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

ToIdent (Ref a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

toIdent :: Ref a -> SrcLoc -> Id #

Assignable (Ref a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

data Arr i a Source #

Mutable array

Instances

Instances details
Eq (Arr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

(==) :: Arr i a -> Arr i a -> Bool #

(/=) :: Arr i a -> Arr i a -> Bool #

ToIdent (Arr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

toIdent :: Arr i a -> SrcLoc -> Id #

Assignable (Arr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

IsPointer (Arr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

runSwapPtr :: Arr i a -> Arr i a -> IO () Source #

data IArr i a Source #

Immutable array

Instances

Instances details
(Ix i, Show i, Show a) => Show (IArr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

showsPrec :: Int -> IArr i a -> ShowS #

show :: IArr i a -> String #

showList :: [IArr i a] -> ShowS #

ToIdent (IArr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

toIdent :: IArr i a -> SrcLoc -> Id #

Assignable (IArr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

data Border i Source #

Constructors

Incl i 
Excl i 

Instances

Instances details
Functor Border Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

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

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

Foldable Border Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

fold :: Monoid m => Border m -> m #

foldMap :: Monoid m => (a -> m) -> Border a -> m #

foldMap' :: Monoid m => (a -> m) -> Border a -> m #

foldr :: (a -> b -> b) -> b -> Border a -> b #

foldr' :: (a -> b -> b) -> b -> Border a -> b #

foldl :: (b -> a -> b) -> b -> Border a -> b #

foldl' :: (b -> a -> b) -> b -> Border a -> b #

foldr1 :: (a -> a -> a) -> Border a -> a #

foldl1 :: (a -> a -> a) -> Border a -> a #

toList :: Border a -> [a] #

null :: Border a -> Bool #

length :: Border a -> Int #

elem :: Eq a => a -> Border a -> Bool #

maximum :: Ord a => Border a -> a #

minimum :: Ord a => Border a -> a #

sum :: Num a => Border a -> a #

product :: Num a => Border a -> a #

Traversable Border Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

traverse :: Applicative f => (a -> f b) -> Border a -> f (Border b) #

sequenceA :: Applicative f => Border (f a) -> f (Border a) #

mapM :: Monad m => (a -> m b) -> Border a -> m (Border b) #

sequence :: Monad m => Border (m a) -> m (Border a) #

Eq i => Eq (Border i) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

(==) :: Border i -> Border i -> Bool #

(/=) :: Border i -> Border i -> Bool #

Num i => Num (Border i) Source #

fromInteger gives an inclusive border. No other methods defined.

Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

(+) :: Border i -> Border i -> Border i #

(-) :: Border i -> Border i -> Border i #

(*) :: Border i -> Border i -> Border i #

negate :: Border i -> Border i #

abs :: Border i -> Border i #

signum :: Border i -> Border i #

fromInteger :: Integer -> Border i #

Show i => Show (Border i) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

showsPrec :: Int -> Border i -> ShowS #

show :: Border i -> String #

showList :: [Border i] -> ShowS #

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.

class ToIdent a => IsPointer a Source #

Types that are represented as a pointers in C

Minimal complete definition

runSwapPtr

Instances

Instances details
IsPointer (Ptr a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

runSwapPtr :: Ptr a -> Ptr a -> IO () Source #

IsPointer (Arr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

runSwapPtr :: Arr i a -> Arr i a -> IO () Source #

data IOMode #

Instances

Instances details
Enum IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Eq IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Methods

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

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

Ord IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Read IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Show IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Ix IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

data Handle Source #

File handle

Instances

Instances details
Eq Handle Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

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

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

Show Handle Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

ToIdent Handle Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

toIdent :: Handle -> SrcLoc -> Id #

stdin :: Handle Source #

Handle to stdin

stdout :: Handle Source #

Handle to stdout

data PrintfArg exp Source #

class (Typeable a, Read a, PrintfArg a) => Formattable a Source #

Values that can be printed/scanned using printf/scanf

Minimal complete definition

formatSpecPrint

Instances

Instances details
Formattable Double Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Float Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Int Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Int8 Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Int16 Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Int32 Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Int64 Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Word Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Word8 Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Word16 Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Word32 Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Formattable Word64 Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

data Ptr (a :: *) Source #

Pointer

Instances

Instances details
Eq (Ptr a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

(==) :: Ptr a -> Ptr a -> Bool #

(/=) :: Ptr a -> Ptr a -> Bool #

Show (Ptr a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

showsPrec :: Int -> Ptr a -> ShowS #

show :: Ptr a -> String #

showList :: [Ptr a] -> ShowS #

ToIdent (Ptr a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

toIdent :: Ptr a -> SrcLoc -> Id #

Assignable (Ptr a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

IsPointer (Ptr a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

runSwapPtr :: Ptr a -> Ptr a -> IO () Source #

data Object Source #

Abstract object

Instances

Instances details
Eq Object Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

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

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

Show Object Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

ToIdent Object Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

toIdent :: Object -> SrcLoc -> Id #

Assignable Object Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

data FunArg exp pred where Source #

Constructors

ValArg :: pred a => exp a -> FunArg exp pred 
AddrArg :: FunArg exp pred -> FunArg exp pred 
DerefArg :: FunArg exp pred -> FunArg exp pred 
OffsetArg :: FunArg exp pred -> exp i -> FunArg exp pred 
FunArg :: Arg arg pred => arg pred -> FunArg exp pred 

Instances

Instances details
(CompExp exp, CompTypeClass ct) => Arg (FunArg exp :: (Type -> Constraint) -> Type) (ct :: Type -> Constraint) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

mkArg :: FunArg exp ct -> CGen Exp Source #

mkParam :: FunArg exp ct -> CGen Param Source #

class ToIdent obj => Assignable obj Source #

Instances

Instances details
Assignable Object Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Assignable (Ptr a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Assignable (Ref a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Assignable (IArr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Assignable (Arr i a) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

data Definition #

Instances

Instances details
Eq Definition 
Instance details

Defined in Language.C.Syntax

Data Definition 
Instance details

Defined in Language.C.Syntax

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Definition -> c Definition #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Definition #

toConstr :: Definition -> Constr #

dataTypeOf :: Definition -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Definition) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Definition) #

gmapT :: (forall b. Data b => b -> b) -> Definition -> Definition #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Definition -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Definition -> r #

gmapQ :: (forall d. Data d => d -> u) -> Definition -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Definition -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Definition -> m Definition #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Definition -> m Definition #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Definition -> m Definition #

Ord Definition 
Instance details

Defined in Language.C.Syntax

Show Definition 
Instance details

Defined in Language.C.Syntax

Located Definition 
Instance details

Defined in Language.C.Syntax

Relocatable Definition 
Instance details

Defined in Language.C.Syntax

Methods

reloc :: Loc -> Definition -> Definition #