Using Haskell's “Maybe”, type declarations [beginner's question]
问题 I've started experimenting with Haskell and have a problem. qqq is a function that should print one string if called with "Nothing" and print other things if called with "Just something". The first attempt seems like working: qqq Nothing = print "There isn't anything to be printed." qqq (Just x) = print "There is something to be printed." >> print x main :: IO () main = qqq (Just 43) But: when I try to make main = qqq (Nothing) it fails ("Ambiguous type variable `a0' in the constraint: (Show