mirror of
https://github.com/ilyakooo0/purescript-indexedDB.git
synced 2024-09-11 06:55:48 +03:00
add missing alternative case for Array in Eq, Ord and Show instances of IDBKey
This commit is contained in:
parent
ae0952a5df
commit
376d435658
@ -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
|
||||
|
||||
|
||||
|
@ -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) =
|
||||
|
Loading…
Reference in New Issue
Block a user