diff options
Diffstat (limited to 'src/Identity.hs')
-rw-r--r-- | src/Identity.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Identity.hs b/src/Identity.hs new file mode 100644 index 0000000..76d0c97 --- /dev/null +++ b/src/Identity.hs @@ -0,0 +1,22 @@ +module Identity ( + Identity(..), +) where + +import Data.Text (Text) + +import Storage + +data Identity = Identity + { idName :: Text + , idPrev :: Maybe (Stored Identity) + } + deriving (Show) + +instance Storable Identity where + store' idt = storeRec $ do + storeText "name" $ idName idt + storeMbRef "prev" $ idPrev idt + + load' = loadRec $ Identity + <$> loadText "name" + <*> loadMbRef "prev" |