Created
May 30, 2019 12:53
-
-
Save MaisaMilena/c9be90a067fa4a6ee0f18202306fc2ab 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
data Page | |
= Home String -- name | |
| MusicLibrary -- RecentlyPlayed, Discover | |
| SongPlaying String String -- music, artist | |
deriving Show | |
data MusicLibrary | |
= RecentlyPlayed -- [String] a localList | |
| Discover -- [String] a default list | |
deriving Show | |
greetings name = do | |
"Hello, " ++ name | |
buildApp page = case page of { | |
Home name -> greetings name; | |
MusicLibrary -> "Building page..."; | |
SongPlaying name artist -> "Playing: " ++ name ++ " - " ++ artist; | |
} | |
runApp = do | |
let page = Home "Maisa" | |
putStrLn (buildApp page) | |
-- TODO: Fazer o app rodar! | |
main :: IO () | |
main = do | |
runApp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment