oi- Library for purely functional lazy interactions with the outer world.

Safe HaskellSafe-Infered





data OI a Source

Datatype for intermediating interaction: OI has two states, non-expressed and exressed. `Non-expressed' indicates that no computation is assigned. In other words, it's value is never denotated by any expression. So, if you refer the value then the process will be suspended until other process determins the value. Non-expressed value can be determined to become expressed for a value by a expression at most once. Expressed indicates that some computation is assigned for the value. And expressed values are never changed.

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

Interaction (a function from a intermediating type to another type) type

Primitive operators on OI

(??) :: OI a -> aSource

Dereference operator

Splitters against OI datatype

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

Interaction driver

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

Drive interaction

IO converters

data IOResult a Source

IOResult for error handling




result :: a


errmsg :: String


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

Convert IO to interaction

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