add missing alternative case for Array in Eq, Ord and Show instances of IDBKey

This commit is contained in:
KtorZ 2017-06-30 18:39:10 +02:00
parent ae0952a5df
commit 376d435658
No known key found for this signature in database
GPG Key ID: 3F72E8BC2894C015
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,5 @@
module Database.IndexedDB.Core
( class FromString, parse
, INDEXED_DB
, IDB
, CursorDirection(..)
, CursorSource(..)
@ -24,9 +23,6 @@ import Data.Maybe (Maybe(..))
import Database.IndexedDB.IDBKey
foreign import data INDEXED_DB :: Effect
foreign import data IDB :: Effect

View File

@ -54,6 +54,8 @@ instance eqKey :: Eq Key where
eq <$> ((fromKey a) :: F String) <*> fromKey b
<|>
eq <$> ((fromKey a) :: F DateTime) <*> fromKey b
<|>
eq <$> ((fromKey a) :: F (Array Key)) <*> fromKey b
where
runIdentity :: forall a. Identity a -> a
runIdentity (Identity x) = x
@ -68,6 +70,8 @@ instance ordKey :: Ord Key where
compare <$> ((fromKey a) :: F String) <*> fromKey b
<|>
compare <$> ((fromKey a) :: F DateTime) <*> fromKey b
<|>
compare <$> ((fromKey a) :: F (Array Key)) <*> fromKey b
where
runIdentity :: forall a. Identity a -> a
runIdentity (Identity x) = x
@ -82,6 +86,8 @@ instance showKey :: Show Key where
(show <$> (fromKey a :: F String))
<|>
(show <$> (fromKey a :: F DateTime))
<|>
(show <$> (fromKey a :: F (Array Key)))
where
format :: forall a. Identity (Either a String) -> String
format (Identity x) =