Last active
July 4, 2017 16:57
-
-
Save deque-blog/d9cbcb80aa1656d064b27b2fe6ad051a to your computer and use it in GitHub Desktop.
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
reserve :: ReservationRequest -> ReservationExpr ReservationResult | |
reserve request = do | |
trains <- SearchTrain (_dateTime request) -- Search for trains at date-time | |
forM trains $ \train -> -- Loop on all the trains | |
typology <- GetTypology train -- Get the typology of a train | |
... -- Implement the reservation rules | |
Log ("Confirming reservation") -- Logging stuff | |
confirmed <- Request reservation -- Trying to reserve the train | |
... -- More stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment