packages feed

fudgets-0.18.4: hsrc/combinators/Route.hs

module Route(compTurnRight, compTurnLeft, compPath) where
import Message(Message(..))
import Path(turn,Direction(..))

compPath (path, ev) wrongaddr c =
    case path of
      L:tag' -> c $ Left (Low (tag', ev))
      R:tag' -> c $ Right (Low (tag', ev))
      _ -> wrongaddr

compTurnLeft  (tag, cmd) = Low (turn L tag, cmd)
compTurnRight (tag, cmd) = Low (turn R tag, cmd)