Skip to content

Instantly share code, notes, and snippets.

@dariathecracker
Last active June 4, 2020 11:42
Show Gist options
  • Save dariathecracker/7139ab75a2f5054bdbd5dbc1d84c528d to your computer and use it in GitHub Desktop.
Save dariathecracker/7139ab75a2f5054bdbd5dbc1d84c528d to your computer and use it in GitHub Desktop.
Implementation
def parse(input: String): UIO[MenuCommand] =
UIO.succeed(input) map {
case "new game" => MenuCommand.NewGame
case "resume" => MenuCommand.Resume
case "quit" => MenuCommand.Quit
case _ => MenuCommand.Invalid
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment