add IDBKey instance to Key

This commit is contained in:
KtorZ 2017-06-30 11:30:06 +02:00
parent ea5183dcc7
commit 302a9f31af
No known key found for this signature in database
GPG Key ID: 3F72E8BC2894C015

View File

@ -88,6 +88,12 @@ instance showKey :: Show Key where
either (const "(Key)") (\s -> "(Key " <> s <> ")") x
instance idbKeyKey :: IDBKey Key where
toKey = id
fromKey = pure
unsafeFromKey = id
instance idbKeyInt :: IDBKey Int where
toKey = Foreign.toForeign >>> Key
fromKey (Key f) = Foreign.readInt f