Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Created November 12, 2017 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethagnawl/98305bec7dfa4645a1733029abc0e83e to your computer and use it in GitHub Desktop.
Save ethagnawl/98305bec7dfa4645a1733029abc0e83e to your computer and use it in GitHub Desktop.
parseArgs :: [a] -> Maybe (a, a)
parseArgs [x, xx] = Just (x, xx)
parseArgs _ = Nothing
main = do
print $ parseArgs [1, 2] -- Just (1, 2)
print $ parseArgs [1, 2, 3] -- Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment