Bring content back
This commit is contained in:
parent
b21cd8d909
commit
b4fcc7857c
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue