This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
evalReservation :: ReservationExpr ty -> IO ty | |
evalReservation = evalCmd | |
where | |
evalCmd :: ReservationExpr ty -> IO ty | |
evalCmd (Log msg) = putStrLn msg | |
evalCmd (Pure val) = pure val | |
evalCmd (Bind val next) = evalCmd val >>= evalCmd . next | |
evalCmd (SearchTrain time) = searchTrainAt time | |
evalCmd (GetTypology trainId) = getTypologyOf trainId | |
evalCmd (Reserve command) = confirmCommand command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment