IOTasks
Safe HaskellNone

Test.IOTasks.Specification

Synopsis

Documentation

data Specification Source #

Instances

Instances details
Arbitrary Specification Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

Monoid Specification Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

Semigroup Specification Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

Show Specification 
Instance details

Defined in Test.IOTasks.Internal.SpecificationGenerator

Methods

showsPrec :: Int -> Specification -> ShowS

show :: Specification -> String

showList :: [Specification] -> ShowS

Eq Specification Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

Ord Specification Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

readInput :: (Typeable a, Read a, Show a) => Var a -> ValueSet a -> InputMode -> Specification Source #

anyOptionalOutput :: Specification Source #

The anyOptionalOutput function represents a specification for writing arbitrary optional output. The output can be anything, as indicated by the use of the wildcard pattern in its definition:

anyOptionalOutput = writeOptionalOutput [wildcard]

branch :: Term 'Transparent Bool -> Specification -> Specification -> Specification Source #

Represents a branching structure in a specification.

while :: Term 'Transparent Bool -> Specification -> Specification Source #

Represents a loop structure in a specification, performing the body while the condition holds.

The while function takes a condition and a body specification, and constructs a loop structure where:

  • The Term 'Transparent Bool argument is the condition to be evaluated at the beginning of each iteration. The loop continues as long as the condition is True.
  • The Specification argument is the body of the loop, executed while the condition is True.

The function assumes that the body specification does not contain a top-level exit marker.

while c bdy = tillExit (branch c bdy exit)

whileNot :: Term 'Transparent Bool -> Specification -> Specification Source #

Represents a loop structure in a specification, performing the body while the condition does not hold.

The whileNot function takes a condition and a body specification, and constructs a loop structure where:

  • The Term 'Transparent Bool argument is the condition to be evaluated at the beginning of each iteration. The loop continues as long as the condition is False.
  • The Specification argument is the body of the loop, executed while the condition is False.

The function assumes that the body specification does not contain a top-level exit marker.

whileNot c bdy = tillExit (branch c exit bdy)

repeatUntil :: Specification -> Term 'Transparent Bool -> Specification Source #

Represents a loop structure in a specification, performing the body at least once and then further while the condition does not hold.

The repeatUntil function takes a body specification and a condition, and constructs a loop structure where:

  • The Specification argument is the body of the loop, executed at least once and then further times while the condition is False.
  • The Term 'Transparent Bool argument is the condition to be evaluated at the end of each iteration. The loop continues until the condition becomes True.

The function assumes that the body specification does not contain a top-level exit marker.

repeatUntil bdy c = tillExit (bdy <> branch c exit nop)

doWhile :: Specification -> Term 'Transparent Bool -> Specification Source #

Represents a loop structure in a specification, performing the body at least once and then further while the condition holds.

The doWhile function takes a body specification and a condition, and constructs a loop structure where:

  • The Specification argument is the body of the loop, executed at least once and then further times while the condition is True.
  • The Term 'Transparent Bool argument is the condition to be evaluated at the end of each iteration. The loop continues until the condition becomes False.

The function assumes that the body specification does not contain a top-level exit marker.

doWhile bdy c = tillExit (bdy <> branch c nop exit)

type AddLinebreaks = Bool Source #

data InputMode Source #

Instances

Instances details
Show InputMode Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

Methods

showsPrec :: Int -> InputMode -> ShowS

show :: InputMode -> String

showList :: [InputMode] -> ShowS

Eq InputMode Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

Methods

(==) :: InputMode -> InputMode -> Bool

(/=) :: InputMode -> InputMode -> Bool

Ord InputMode Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

Methods

compare :: InputMode -> InputMode -> Ordering

(<) :: InputMode -> InputMode -> Bool

(<=) :: InputMode -> InputMode -> Bool

(>) :: InputMode -> InputMode -> Bool

(>=) :: InputMode -> InputMode -> Bool

max :: InputMode -> InputMode -> InputMode

min :: InputMode -> InputMode -> InputMode

data LoopBody Source #

Constructors

LoopBody 

Instances

Instances details
Arbitrary LoopBody Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

Show LoopBody Source # 
Instance details

Defined in Test.IOTasks.Internal.Specification

Methods

showsPrec :: Int -> LoopBody -> ShowS

show :: LoopBody -> String

showList :: [LoopBody] -> ShowS