Module Observe

The Oberserve library containing combinators to observe data.

Author: Bernd Brassle, Olaf Chitil, Michael Hanus, Frank Huch

Version: February 2023

Summary of exported operations:

observe :: Data a => (a -> String -> Int -> [Int] -> a) -> String -> a -> a  Non-deterministic 
The basic operation to observe the evaluation of data structures.
observeG :: (a -> String -> Int -> [Int] -> a) -> String -> a -> a  Non-deterministic 
The basic operation to observe the evaluation of ground data structures.
oLit :: Show a => a -> String -> Int -> [Int] -> a  Non-deterministic 
oInt :: Int -> String -> Int -> [Int] -> Int  Non-deterministic 
oBool :: Bool -> String -> Int -> [Int] -> Bool  Non-deterministic 
oChar :: Char -> String -> Int -> [Int] -> Char  Non-deterministic 
oFloat :: Float -> String -> Int -> [Int] -> Float  Non-deterministic 
oOpaque :: a -> String -> Int -> [Int] -> a  Non-deterministic 
oOpaqueConstr :: String -> a -> String -> Int -> [Int] -> a  Non-deterministic 
oList :: Data a => (a -> String -> Int -> [Int] -> a) -> [a] -> String -> Int -> [Int] -> [a]  Non-deterministic 
oString :: String -> String -> Int -> [Int] -> String  Non-deterministic 
oPair :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a,b) -> String -> Int -> [Int] -> (a,b)  Non-deterministic 
oTriple :: (Data a, Data b, Data c) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (a,b,c) -> String -> Int -> [Int] -> (a,b,c)  Non-deterministic 
o4Tuple :: (Data a, Data b, Data c, Data d) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (d -> String -> Int -> [Int] -> d) -> (a,b,c,d) -> String -> Int -> [Int] -> (a,b,c,d)  Non-deterministic 
o5Tuple :: (Data a, Data b, Data c, Data d, Data e) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (d -> String -> Int -> [Int] -> d) -> (e -> String -> Int -> [Int] -> e) -> (a,b,c,d,e) -> String -> Int -> [Int] -> (a,b,c,d,e)  Non-deterministic 
oMaybe :: Data a => (a -> String -> Int -> [Int] -> a) -> Maybe a -> String -> Int -> [Int] -> Maybe a  Non-deterministic 
oEither :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> Either a b -> String -> Int -> [Int] -> Either a b  Non-deterministic 
oFun :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 
(~>) :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 
oFunFG :: Data a => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 
(~~>) :: Data a => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 
oFunG :: (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 
(~~~>) :: (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 
o0 :: String -> a -> String -> Int -> [Int] -> a  Non-deterministic 
o1 :: Data a => (a -> String -> Int -> [Int] -> a) -> String -> (a -> b) -> a -> String -> Int -> [Int] -> b  Non-deterministic 
o2 :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> String -> (a -> b -> c) -> a -> b -> String -> Int -> [Int] -> c  Non-deterministic 
o3 :: (Data a, Data b, Data c) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> String -> (a -> b -> c -> d) -> a -> b -> c -> String -> Int -> [Int] -> d  Non-deterministic 
o4 :: (Data a, Data b, Data c, Data d) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (d -> String -> Int -> [Int] -> d) -> String -> (a -> b -> c -> d -> e) -> a -> b -> c -> d -> String -> Int -> [Int] -> e  Non-deterministic 
o5 :: (Data a, Data b, Data c, Data d, Data e) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (d -> String -> Int -> [Int] -> d) -> (e -> String -> Int -> [Int] -> e) -> String -> (a -> b -> c -> d -> e -> f) -> a -> b -> c -> d -> e -> String -> Int -> [Int] -> f  Non-deterministic 
clearLogFile :: IO ()  Deterministic 

Exported datatypes:


Observer

Type synonym: Observer a = a -> Label -> EventID -> [EventID] -> a


Exported operations:

observe :: Data a => (a -> String -> Int -> [Int] -> a) -> String -> a -> a  Non-deterministic 

The basic operation to observe the evaluation of data structures. It has a Data context so that it can also observe the instantiation of free variables occurring in data structures.

observeG :: (a -> String -> Int -> [Int] -> a) -> String -> a -> a  Non-deterministic 

The basic operation to observe the evaluation of ground data structures. It does not require a Data context but it can not observe the instantiation of free variables occurring in data structures. Thus, it has to be ensured that free variables do not occur in the observed structures, otherwise this observer always suspends.

oLit :: Show a => a -> String -> Int -> [Int] -> a  Non-deterministic 

oInt :: Int -> String -> Int -> [Int] -> Int  Non-deterministic 

oBool :: Bool -> String -> Int -> [Int] -> Bool  Non-deterministic 

oChar :: Char -> String -> Int -> [Int] -> Char  Non-deterministic 

oFloat :: Float -> String -> Int -> [Int] -> Float  Non-deterministic 

oOpaque :: a -> String -> Int -> [Int] -> a  Non-deterministic 

oOpaqueConstr :: String -> a -> String -> Int -> [Int] -> a  Non-deterministic 

oList :: Data a => (a -> String -> Int -> [Int] -> a) -> [a] -> String -> Int -> [Int] -> [a]  Non-deterministic 

oString :: String -> String -> Int -> [Int] -> String  Non-deterministic 

oPair :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a,b) -> String -> Int -> [Int] -> (a,b)  Non-deterministic 

oTriple :: (Data a, Data b, Data c) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (a,b,c) -> String -> Int -> [Int] -> (a,b,c)  Non-deterministic 

o4Tuple :: (Data a, Data b, Data c, Data d) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (d -> String -> Int -> [Int] -> d) -> (a,b,c,d) -> String -> Int -> [Int] -> (a,b,c,d)  Non-deterministic 

o5Tuple :: (Data a, Data b, Data c, Data d, Data e) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (d -> String -> Int -> [Int] -> d) -> (e -> String -> Int -> [Int] -> e) -> (a,b,c,d,e) -> String -> Int -> [Int] -> (a,b,c,d,e)  Non-deterministic 

oMaybe :: Data a => (a -> String -> Int -> [Int] -> a) -> Maybe a -> String -> Int -> [Int] -> Maybe a  Non-deterministic 

oEither :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> Either a b -> String -> Int -> [Int] -> Either a b  Non-deterministic 

oFun :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 

(~>) :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 

Further infos:
  • defined as right-associative infix operator with precedence 5

oFunFG :: Data a => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 

(~~>) :: Data a => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 

Further infos:
  • defined as right-associative infix operator with precedence 5

oFunG :: (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 

(~~~>) :: (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (a -> b) -> String -> Int -> [Int] -> a -> b  Non-deterministic 

Further infos:
  • defined as right-associative infix operator with precedence 5

o0 :: String -> a -> String -> Int -> [Int] -> a  Non-deterministic 

o1 :: Data a => (a -> String -> Int -> [Int] -> a) -> String -> (a -> b) -> a -> String -> Int -> [Int] -> b  Non-deterministic 

o2 :: (Data a, Data b) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> String -> (a -> b -> c) -> a -> b -> String -> Int -> [Int] -> c  Non-deterministic 

o3 :: (Data a, Data b, Data c) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> String -> (a -> b -> c -> d) -> a -> b -> c -> String -> Int -> [Int] -> d  Non-deterministic 

o4 :: (Data a, Data b, Data c, Data d) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (d -> String -> Int -> [Int] -> d) -> String -> (a -> b -> c -> d -> e) -> a -> b -> c -> d -> String -> Int -> [Int] -> e  Non-deterministic 

o5 :: (Data a, Data b, Data c, Data d, Data e) => (a -> String -> Int -> [Int] -> a) -> (b -> String -> Int -> [Int] -> b) -> (c -> String -> Int -> [Int] -> c) -> (d -> String -> Int -> [Int] -> d) -> (e -> String -> Int -> [Int] -> e) -> String -> (a -> b -> c -> d -> e -> f) -> a -> b -> c -> d -> e -> String -> Int -> [Int] -> f  Non-deterministic 

clearLogFile :: IO ()  Deterministic