Created
October 19, 2011 22:58
-
-
Save 23Skidoo/1299937 to your computer and use it in GitHub Desktop.
Indentation error
This file contains 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
type Title = String | |
type Author = String | |
data Product = Book Title Author | |
| Video Author | |
| CD Title Integer Author | |
deriving (Eq,Show) | |
getTitle (Book title _ ) = title | |
getTitle (Video title ) = title | |
getTitle (CD title _ _ ) =title | |
getTitles l = map (\x->getTitle x) l | |
lookupTitle _ [] = Nothing | |
lookupTitle x (y:ys) | getTitle y==x = Just y | |
|otherwise = lookupTitle x ys | |
lookupTitles a b = map (\x->lookupTitle x b) a | |
bookAuthors l = filter author l | |
where author (Book _ _) = True | |
author _ = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment