summaryrefslogtreecommitdiff
path: root/Biz/Ibb/Keep.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/Ibb/Keep.hs')
-rw-r--r--Biz/Ibb/Keep.hs31
1 files changed, 15 insertions, 16 deletions
diff --git a/Biz/Ibb/Keep.hs b/Biz/Ibb/Keep.hs
index c7dabb0..074a42a 100644
--- a/Biz/Ibb/Keep.hs
+++ b/Biz/Ibb/Keep.hs
@@ -28,10 +28,9 @@ import qualified Data.Text as Text
-- * Keep
-- | Main database. Need to think of a better name for this.
-newtype IbbKeep
- = IbbKeep
- { _people :: IxSet Person
- }
+newtype IbbKeep = IbbKeep
+ { _people :: IxSet Person
+ }
deriving (Data, Typeable)
$(deriveSafeCopy 0 'base ''IbbKeep)
@@ -51,20 +50,20 @@ newtype PersonBlurb
instance Indexable Person where
empty =
ixSet
- [ ixFun $ \p -> [PersonName $ _name p],
- ixFun $ \p -> [_pic p],
- ixFun $ \p -> [_twitter p],
- ixFun $ \p -> [_website p],
- ixFun $ \p -> [_books p],
- ixFun $ \p -> [PersonBlurb $ _blurb p]
+ [ ixFun <| \p -> [PersonName <| _name p],
+ ixFun <| \p -> [_pic p],
+ ixFun <| \p -> [_twitter p],
+ ixFun <| \p -> [_website p],
+ ixFun <| \p -> [_books p],
+ ixFun <| \p -> [PersonBlurb <| _blurb p]
]
-- | updates the `IbbKeep` with a new `Person`
newPerson :: Text -> Text -> Update IbbKeep Person
newPerson name blurb = do
keep <- get
- put $
- k
+ put
+ <| k
{ _people = IxSet.insert p (_people k)
}
return p
@@ -97,16 +96,16 @@ newtype BookAuthor
instance Indexable Book where
empty =
ixSet
- [ ixFun $ \b -> [BookTitle $ _title b],
- ixFun $ \b -> [BookAuthor $ _author b],
- ixFun $ \b -> [_amznref b]
+ [ ixFun <| \b -> [BookTitle <| _title b],
+ ixFun <| \b -> [BookAuthor <| _author b],
+ ixFun <| \b -> [_amznref b]
]
-- | updates the `IbbKeep` with a new `Book`
-- newBook :: Text -> Text -> Text -> Update IbbKeep Book
-- newBook title author amznref = do
-- ibbKeep <- get
--- put $ ibbKeep { _books = IxSet.insert b (_books ibbKeep)
+-- put <| ibbKeep { _books = IxSet.insert b (_books ibbKeep)
-- , _people = _people ibbKeep
-- }
-- return b