oi-0.1.0: Purely Functional Lazy Interaction with the outer world

Data.OI.Base

Synopsis

# Interaction datatypes

data OI a Source

Datatype for intermediating interaction

Instances

type :-> a b = OI a -> bSource

Interaction type

# Drive an interaction

run :: (OI a -> b) -> IO bSource

Drive interaction

# Primitive operators on OI

(=:) :: a -> OI a -> aSource

Assign operator

(??) :: OI a -> aSource

Dereference operator

# Splitter against OI

dePair :: OI (a, b) -> (OI a, OI b)Source

Decomposer for pair

deList :: OI [a] -> Maybe (OI a, OI [a])Source

Decomposer for list

deTriple :: OI (a, b, c) -> (OI a, OI b, OI c)Source

Decomposer for triple

deTuple4 :: OI (a, b, c, d) -> (OI a, OI b, OI c, OI d)Source

Decomposer for 4-tuple

deTuple5 :: OI (a, b, c, d, e) -> (OI a, OI b, OI c, OI d, OI e)Source

Decomposer for 5-tuple

deTuple6 :: OI (a, b, c, d, e, f) -> (OI a, OI b, OI c, OI d, OI e, OI f)Source

Decomposer for 6-tuple

deTuple7 :: OI (a, b, c, d, e, f, g) -> (OI a, OI b, OI c, OI d, OI e, OI f, OI g)Source

Decomposer for 7-tuple

deLeft :: OI (Either a b) -> Either (OI a) (OI b)Source

deRight :: OI (Either a b) -> Either (OI a) (OI b)Source

# Convert IO to interaction

data IOResult a Source

Constructors

 Success a Failure String

Instances

 Functor IOResult Show a => Show (IOResult a)

iooi :: IO a -> OI a -> aSource

Convert IO to interaction

iooi' :: IO a -> OI (IOResult a) -> IOResult aSource

# Forcing

forces :: [()] -> ()Source

Forcing utilities

force :: a -> ()Source

split :: a -> (a, ())Source