Created
February 22, 2017 09:18
-
-
Save paulvictor/e8625977cda8e4d8a10cde90e9dbd87e to your computer and use it in GitHub Desktop.
Monadic composition of screens
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
flow = do | |
_ <- splashScreen | |
l <- languageSet | |
pure(l ? npciSplashScreen : ChooseLanguageScreen) | |
npciSplashScreen = do | |
_ <- wait 0 | |
permission <- checkPermission | |
pure(permission ? postPermission : showPermission) | |
postPermission = do | |
t <- registrationToken | |
pure(t ? rtSet : rtNotSet) | |
rtSet = do | |
pc <- passCode | |
pure(pc ? loginScreen : registerScreen) | |
rtNotSet = do | |
nw <- networkAvailable | |
isBound <- bindDevice | |
guard isBound | |
cs <- call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment