fork download
  1. {-# LANGUAGE OverloadedStrings #-}
  2. module MyBooks where
  3.  
  4. import qualified Data.Text.Lazy as T
  5. import qualified Data.Time.Calendar as C
  6.  
  7.  
  8. data Publisher = OReilly
  9. | Manning
  10. | Pragmatic_Bookshelf
  11. | Apress
  12. | Packt_Pub
  13. | Leanpub
  14. | Ohm_sha
  15. | Tatsujin
  16. | OReilly_JP
  17. | Gihyo
  18. deriving(Show, Eq, Ord)
  19.  
  20. data BookCat a = Algorithms a
  21. | Language a
  22. | DataScience a
  23. | Math a
  24. | Science
  25. | Other a
  26. deriving(Show, Eq)
  27.  
  28. data BookInfo = BookInfo {title :: T.Text
  29. , author :: Maybe T.Text
  30. , publisher :: Maybe Publisher
  31. , bookCats :: Maybe [BookCat T.Text]
  32. , downloadedVersion :: Maybe T.Text
  33. , downloadedDate :: Maybe C.Day
  34. } deriving (Show, Eq)
  35. defaultBookInfo :: BookInfo
  36. defaultBookInfo = BookInfo{title = ""
  37. , author = Nothing
  38. , publisher = Nothing
  39. , bookCats = Nothing
  40. , downloadedVersion = Nothing
  41. , downloadedDate = Nothing
  42. }
  43.  
  44.  
  45. myBook = defaultBookInfo {title = "Java8", author = Just "java"}
  46.  
  47. main = print myBook
  48.  
  49.  
  50.  
  51.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.hs:4:18:
    Could not find module `Data.Text.Lazy'
    Perhaps you meant
      Data.Map.Lazy (from containers-0.5.0.0)
      Data.STRef.Lazy (from base)
    Use -v to see a list of the files searched for.
stdout
Standard output is empty