Skip to content

Instantly share code, notes, and snippets.

@Nucleareal
Created July 15, 2014 01:15
Show Gist options
  • Save Nucleareal/3ec6765334ac022c4a55 to your computer and use it in GitHub Desktop.
Save Nucleareal/3ec6765334ac022c4a55 to your computer and use it in GitHub Desktop.
data AorOther = A | Other deriving (Show, Eq)
instance Read AorOther where
read x
| x == "A" = A
| otherwise = Other
toString :: AorOther -> String
toString x = " Your Input is " ++ show x
main = do
p <- readLn
putStrLn $ toString p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment