git.iko.soy/purescript-indexed-DB
on master help sign in
add missing alternative case for Array in Eq, Ord and Show instances of IDBKey
commit376d435658ca72b1ab552ead3112b280d2fd2c1c authorKtorZ <matthias.benkort@gmail.com> dateFri 30 Jun 2017, 18:39 (9 years ago) parentae0952a
2 files changed+6−4
src/Database/IndexedDB/Core.purs−4 src/Database/IndexedDB/IDBKey/Internal.purs+6
src/Database/IndexedDB/Core.purs−4
@@ -1,6 +1,5 @@
11module Database.IndexedDB.Core
22 ( class FromString, parse
3− , INDEXED_DB
43 , IDB
54 , CursorDirection(..)
65 , CursorSource(..)
@@ -24,9 +23,6 @@ import Data.Maybe (Maybe(..))
2423import Database.IndexedDB.IDBKey
2524
2625
27−foreign import data INDEXED_DB :: Effect
28−
29−
3026foreign import data IDB :: Effect
3127
3228
src/Database/IndexedDB/IDBKey/Internal.purs+6
@@ -54,6 +54,8 @@ instance eqKey :: Eq Key where
5454 eq <$> ((fromKey a) :: F String) <*> fromKey b
5555 <|>
5656 eq <$> ((fromKey a) :: F DateTime) <*> fromKey b
57+ <|>
58+ eq <$> ((fromKey a) :: F (Array Key)) <*> fromKey b
5759 where
5860 runIdentity :: forall a. Identity a -> a
5961 runIdentity (Identity x) = x
@@ -68,6 +70,8 @@ instance ordKey :: Ord Key where
6870 compare <$> ((fromKey a) :: F String) <*> fromKey b
6971 <|>
7072 compare <$> ((fromKey a) :: F DateTime) <*> fromKey b
73+ <|>
74+ compare <$> ((fromKey a) :: F (Array Key)) <*> fromKey b
7175 where
7276 runIdentity :: forall a. Identity a -> a
7377 runIdentity (Identity x) = x
@@ -82,6 +86,8 @@ instance showKey :: Show Key where
8286 (show <$> (fromKey a :: F String))
8387 <|>
8488 (show <$> (fromKey a :: F DateTime))
89+ <|>
90+ (show <$> (fromKey a :: F (Array Key)))
8591 where
8692 format :: forall a. Identity (Either a String) -> String
8793 format (Identity x) =