Kombinatoren für Folgen

type Series a = Int -> [a]

(\/) :: Series a -> Series a -> Series a
s1 \/ s2 = \ d -> s1 d ++ s2 d
(><) :: Series a -> Series b -> Series (a,b)
s1 >< s2 = \ d -> 
    do x1 <- s1 d; x2 <- s2 d; return (x1, x2)

cons0 :: a             -> Series a
cons1 :: Serial a 
      => (a -> b)      -> Series b
cons2 :: ( Serial a, Serial b) 
      => (a -> b -> c) -> Series c



Johannes Waldmann 2011-01-18