diff options
author | Ben Sima <ben@bsima.me> | 2019-03-27 16:24:07 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-03-27 16:24:07 -0700 |
commit | 1cfeff547d80eb61a1db8102f06011e73dd2fd9f (patch) | |
tree | 8efeed3a3c8245fe916494aeb49cb33980b7dea5 /lore/Biz/Ibb/Influencers.hs | |
parent | 3f0471b314fa2792207b3116aa7491f5f353b31e (diff) |
almost working
Diffstat (limited to 'lore/Biz/Ibb/Influencers.hs')
-rw-r--r-- | lore/Biz/Ibb/Influencers.hs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lore/Biz/Ibb/Influencers.hs b/lore/Biz/Ibb/Influencers.hs index beeaf41..f00fe2e 100644 --- a/lore/Biz/Ibb/Influencers.hs +++ b/lore/Biz/Ibb/Influencers.hs @@ -1,7 +1,10 @@ {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DeriveGeneric #-} module Biz.Ibb.Influencers where +import Data.Aeson import Data.Text.Lazy (Text) +import GHC.Generics (Generic) data Person = Person { _name :: Text @@ -10,13 +13,19 @@ data Person = Person , _website :: Text , _books :: [Book] , _blurb :: Text - } deriving (Show, Eq) + } deriving (Generic, Show, Eq) + +instance FromJSON Person +instance ToJSON Person data Book = Book { _title :: Text , _author :: Text , _amznref :: Text - } deriving (Show, Eq) + } deriving (Generic, Show, Eq) + +instance FromJSON Book +instance ToJSON Book allPeople :: [Person] allPeople = |