Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main where
- data Letter a =
- A a
- | B a
- | C String
- deriving (Show)
- -- getConstructor :: String -> (a -> Letter ?) -- <==
- getConstructor x
- | x == "a" = A
- | x == "b" = B
- | otherwise = C
- main = print $ theType
- where theType = (getConstructor "b") "its b!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement