Created
July 15, 2014 01:15
-
-
Save Nucleareal/3ec6765334ac022c4a55 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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