git.iko.soy/purescript-indexed-DB
on master help sign in
add sugar 'none' for (Nothing :: Maybe Key)
commit5f9f3413c55b11548f89e90eb5795f8bb3654b3a authorKtorZ <matthias.benkort@gmail.com> dateFri 7 Jul 2017, 11:39 (9 years ago) parent3c3b1b2
2 files changed+8−1
src/Database/IndexedDB/IDBKey.purs+1−1 src/Database/IndexedDB/IDBKey/Internal.purs+7
src/Database/IndexedDB/IDBKey.purs+1−1
@@ -5,4 +5,4 @@ module Database.IndexedDB.IDBKey
55 ( module Database.IndexedDB.IDBKey.Internal
66 ) where
77
8−import Database.IndexedDB.IDBKey.Internal(Key, class IDBKey, toKey, fromKey, unsafeFromKey)
8+import Database.IndexedDB.IDBKey.Internal(class IDBKey, Key, none, toKey, fromKey, unsafeFromKey)
src/Database/IndexedDB/IDBKey/Internal.purs+7
@@ -3,6 +3,7 @@
33-- | NOTE: Binary keys aren't supported yet.
44module Database.IndexedDB.IDBKey.Internal
55 ( Key(..)
6+ , none
67 , class IDBKey, toKey , fromKey , unsafeFromKey
78 , extractForeign
89 ) where
@@ -22,6 +23,7 @@ import Data.List.NonEmpty (NonEmptyList(..))
2223import Data.List.Types (List(..))
2324import Data.NonEmpty (NonEmpty(..))
2425import Data.Either (Either(..), either, isRight)
26+import Data.Maybe (Maybe(..))
2527import Data.Identity (Identity(..))
2628import Data.Nullable (Nullable, toNullable)
2729import Data.Time as Time
@@ -50,6 +52,11 @@ class IDBKey a where
5052 unsafeFromKey :: Key -> a
5153
5254
55+none :: Maybe Key
56+none =
57+ Nothing
58+
59+
5360--------------------
5461-- INSTANCES
5562--