add sugar 'none' for (Nothing :: Maybe Key)

This commit is contained in:
KtorZ 2017-07-07 11:39:02 +02:00
parent 3c3b1b2f9b
commit 5f9f3413c5
No known key found for this signature in database
GPG Key ID: 3F72E8BC2894C015
2 changed files with 8 additions and 1 deletions

View File

@ -5,4 +5,4 @@ module Database.IndexedDB.IDBKey
( module Database.IndexedDB.IDBKey.Internal
) where
import Database.IndexedDB.IDBKey.Internal(Key, class IDBKey, toKey, fromKey, unsafeFromKey)
import Database.IndexedDB.IDBKey.Internal(class IDBKey, Key, none, toKey, fromKey, unsafeFromKey)

View File

@ -3,6 +3,7 @@
-- | NOTE: Binary keys aren't supported yet.
module Database.IndexedDB.IDBKey.Internal
( Key(..)
, none
, class IDBKey, toKey , fromKey , unsafeFromKey
, extractForeign
) where
@ -22,6 +23,7 @@ import Data.List.NonEmpty (NonEmptyList(..))
import Data.List.Types (List(..))
import Data.NonEmpty (NonEmpty(..))
import Data.Either (Either(..), either, isRight)
import Data.Maybe (Maybe(..))
import Data.Identity (Identity(..))
import Data.Nullable (Nullable, toNullable)
import Data.Time as Time
@ -50,6 +52,11 @@ class IDBKey a where
unsafeFromKey :: Key -> a
none :: Maybe Key
none =
Nothing
--------------------
-- INSTANCES
--