You are here: Home PIK Members Daniel Lincke Software specifications MonSys-spec

MonSys-spec

The type-declarations for the monadic systems library.

Haskell source code icon MonSys.hs — Haskell source code, 1 KB

File contents

class Functor f where
    fmap :: (a -> b) -> f a -> f b

class Monad m where
    mreturn :: a -> m a 
    mbind   :: (a -> m b, m a) -> m b

macro_trj :: (Monad m) =>  (i -> (x -> m x)) -> List i -> x -> List (m x)
-- macro_trj sys ts x  =  scanr (\i mx -> mx >>= sys i) (return x) ts

addHist :: (Monad f) => (x -> f x) -> List x -> f (List x)
-- addHist g (x : xs) = liftM (:(x : xs)) (g x)

micro_trj :: (Monad m) =>  (i -> (x -> m x)) -> List i -> x -> m (List x)
-- micro_trj sys is x  =  mcompose (map (addHist . sys) is) [x]

vulnerability :: (Functor m, Monad m) => ((i -> x -> m x), (List x -> h), (m h -> v), List i, x) -> v
-- vulnerability sys harm measure ts = measure . fmap harm . micro_trj sys ts

Document Actions