Compilers are good for… compiling.
compiler :: Source -> Input -> Output -- Oversimplified...
compiler :: Source -> Maybe (Input -> Output) -- Still oversimplified
…but what if there is more to them than that?
type Source = Text
compiler :: Source -> Error (Input -> Output) -- Still oversimplified
magic = fmap (const ()) . compiler :: Text -> Error ()
data Tag = Fiction | Programming | FunctionalProgramming
data Status = Done | Reading Rational | Todo
data Language = EN | SK | CZ
data Format = TextBook | AudioBook
data Book = Book
{ name :: String
, authors :: [String]
, progress :: Status
, notes :: String
, language :: Language
, format :: Format
, tags :: [Tag]
}
;-)
.
Of course, you can do very similar things with other compilers as well, though there is something to Haskell that makes it well suited for this.
P.S.: For extra awesomeness do not forget to throw in some version control.
Thank you for your attention.