From b4fcc7857ccc51461386967033a70339eb19885c Mon Sep 17 00:00:00 2001 From: Tissevert Date: Wed, 10 Apr 2019 10:44:53 +0200 Subject: [PATCH] Bring content back --- src/Medicine.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Medicine.hs b/src/Medicine.hs index 1c7277b..253ac44 100644 --- a/src/Medicine.hs +++ b/src/Medicine.hs @@ -16,12 +16,14 @@ type MedicineName = String data Medicine = Medicine { name :: MedicineName + , content :: Float , minStock :: Float } deriving (Show) instance Row Medicine where fromRow assoc = Medicine <$> get "name" + <*> (read <$> get "content") <*> (read <$> get "minStock") where get key = maybe (Left $ Expect key) Right $ Map.lookup key assoc