diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2019-05-02 22:55:09 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2019-05-02 22:55:09 +0200 |
commit | 8a03527dba479b520ebda47cdf00080d82d4e933 (patch) | |
tree | a6b8d4c0f962fa30b2812402456b6ead8a7b1673 /src/Identity.hs | |
parent | 4b722b1ca195e70e2ac6518d88f79eb40a1095b2 (diff) |
Basic local network peer discovery
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" |