ivory-0.1.0.0: Safe embedded C programming.

Safe HaskellNone

Ivory.Language.Cond

Synopsis

Documentation

emitPreCond :: Require -> Ivory eff ()Source

Emit a pre-condition.

XXX do not export

emitPostCond :: Ensure -> Ivory eff ()Source

Emit a post-condition.

XXX do not export

newtype Cond Source

Constructors

Cond 

Fields

runCond :: forall eff. Ivory eff Cond

Use the naming environment from the Ivory monad.

check :: IBool -> CondSource

Checkable a boolean expression.

checkStored :: forall ref s a. (IvoryVar a, IvoryRef ref, IvoryVar (ref s (Stored a))) => ref s (Stored a) -> (a -> IBool) -> CondSource

class Requires c whereSource

Proc bodies that have pre-conditions. Multiple pre-conditions may be provided, for which the conjunction must hold.

Methods

requires :: IvoryType r => c -> Body r -> Body rSource

requires' :: (Requires c, IvoryType r) => (c -> Cond) -> c -> Body r -> Body rSource

class Ensures c whereSource

Proc bodies that have post-conditions. Multiple post-conditions may be provided, for which the conjunction must hold.

Methods

ensures :: IvoryVar r => (r -> c) -> Body r -> Body rSource

ensures' :: (Ensures c, IvoryVar r) => (c -> Cond) -> (r -> c) -> Body r -> Body rSource