@@ -8,8 +8,7 @@
88-- | by the API.
99
1010module Database.IndexedDB.Core
11− ( class FromString, parse
12− , IDB
11+ ( IDB
1312 , CursorDirection(..)
1413 , CursorSource(..)
1514 , Database
@@ -28,6 +27,7 @@ import Prelude (class Show)
2827
2928import Control.Monad.Eff (kind Effect)
3029import Data.Maybe (Maybe(..))
30+import Data.String.Read (class Read)
3131
3232import Database.IndexedDB.IDBKey
3333
@@ -109,11 +109,6 @@ foreign import data Transaction :: Type
109109foreign import data ValueCursor :: Type
110110
111111
112−-- | FromString represents enumerations that can be represented as Strings.
113−class FromString a where
114− parse :: String -> Maybe a
115−
116−
117112foreign import _showCursor :: forall cursor. cursor -> String
118113instance showKeyCursor :: Show KeyCursor where
119114 show = _showCursor
@@ -175,8 +170,8 @@ instance showTransactionMode :: Show TransactionMode where
175170 VersionChange -> "versionchange"
176171
177172
178−instance fromStringCursorDirection :: FromString CursorDirection where
179− parse s =
173+instance readCursorDirection :: Read CursorDirection where
174+ read s =
180175 case s of
181176 "next" -> Just Next
182177 "nextunique" -> Just NextUnique
@@ -185,8 +180,8 @@ instance fromStringCursorDirection :: FromString CursorDirection where
185180 _ -> Nothing
186181
187182
188−instance fromStringTransactionMode :: FromString TransactionMode where
189− parse s =
183+instance readTransactionMode :: Read TransactionMode where
184+ read s =
190185 case s of
191186 "readonly" -> Just ReadOnly
192187 "readwrite" -> Just ReadWrite