------------------------------------------------------------------------------- -- $Id: Below.hs#1 2009/10/01 10:31:09 REDMOND\\satnams $ ------------------------------------------------------------------------------- module Lava.Below where ------------------------------------------------------------------------------- -- 4-Sided Tile Combinators ------------------------------------------------------------------------------- -- BELOW -- g -- ^ -- | -- ----- -- | | -- e ->| s |-> f -- | | -- ----- -- ^ -- | -- d -- ^ -- | -- ----- -- | | -- b ->| r |-> c -- | | -- ----- -- ^ -- | -- a ------------------------------------------------------------------------------- below :: Monad m => (((a, b) -> m (c, d)) -> -- type of r ((d, e) -> m (f, g)) -> -- type of s ((a, (b,e)) -> m ((c,f), g))) -- type of result below r s (a, (b,e)) = do (c,d) <- r (a, b) (f,g) <- s (d, e) return ((c,f), g) -------------------------------------------------------------------------------