From 1cfeff547d80eb61a1db8102f06011e73dd2fd9f Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 27 Mar 2019 16:24:07 -0700 Subject: almost working --- lore/Biz/Ibb/Influencers.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lore/Biz/Ibb/Influencers.hs') 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 = -- cgit v1.2.3