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