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

Safe HaskellSafe-Infered

Data.OI

Contents

Synopsis

Data type

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

Converter an IO to an interaction function

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

Convert an IO to an interaction function

Drive an interaction function

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

Drive an interaction function

Primitive operators on the interaction data

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

Binding operator

(?) :: a :-> aSource

Dereference operator

(#) :: a -> OI aSource

Reference operator

Category class methods on (:->)

idA :: a :-> aSource

(<.>) :: (b :-> c) -> (a :-> b) -> a :-> cSource

Arrow class methods on (:->)

arrA :: (a -> b) -> a :-> bSource

firstA :: (a :-> b) -> (a, c) :-> (b, c)Source

Embeding interaction data in data structure

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

Embed interactions into tuple

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

Embed interactions into triple

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

Embed interactions into list

Interaction combinators

(>|>|) :: (a -> b :-> c) -> (c -> d :-> e) -> a -> (b, d) :-> eSource

(|<|<) :: (c -> d :-> e) -> (a -> b :-> c) -> a -> (b, d) :-> eSource

Connect two interactions into an interaction

(>|->|) :: (a -> b :-> c) -> (a' -> b' :-> c') -> (a, a') -> (b, b') :-> (c, c')Source

(|-|) :: (a :-> b) -> (a' :-> b') -> (a, a') :-> (b, b')Source

(|<|) :: (b -> c :-> d) -> (a :-> b) -> (a, c) :-> dSource

(|>|) :: (a :-> b) -> (b -> c :-> d) -> (a, c) :-> dSource

(<|) :: (b -> c) -> (a :-> b) -> a :-> cSource

(|>) :: (a :-> b) -> (b -> c) -> a :-> cSource

(|><|) :: (q -> a :-> (p, c)) -> (p -> b :-> (q, d)) -> (a, b) :-> (c, d)Source

mapOI :: (a :-> b) -> [a] :-> [b]Source

Map interaction function on an interaction list

mapOI' :: (a :-> b) -> [a] :-> (OI [a], [b])Source

Map interaction function on an interaction list (return results and remainings)

zipWithOI :: (a -> b :-> c) -> [a] -> [b] :-> [c]Source

Zip a list and an interaction list

zipWithOI' :: (a -> b :-> c) -> [a] -> [b] :-> (OI [b], [c])Source

Zip a list and an interaction list (return results and remainings)

sequenceOI :: [a :-> b] -> [a] :-> ()Source

Sequencing interaction functions

sequenceOI' :: [a :-> b] -> [a] :-> OI [a]Source

Sequencing interaction functions (return remainings)

mergeOI :: [a] -> [a] -> [a] :-> [a]Source

Merging two lists by using oracles