Add "char" to Char mapping

This commit is contained in:
rightfold 2016-12-24 00:11:23 +01:00
parent 6fb1844d4d
commit 726edddffd

View File

@ -23,7 +23,7 @@ import Control.Monad.Aff (Aff)
import Control.Monad.Error.Class (catchError, throwError) import Control.Monad.Error.Class (catchError, throwError)
import Control.Monad.Except (runExcept) import Control.Monad.Except (runExcept)
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Foreign (Foreign, readArray, readString, toForeign) import Data.Foreign (Foreign, readArray, readChar, readString, toForeign)
import Data.List (List) import Data.List (List)
import Data.List as List import Data.List as List
import Data.Maybe (fromJust, Maybe(..)) import Data.Maybe (fromJust, Maybe(..))
@ -108,6 +108,12 @@ instance fromSQLRowTuple5 :: (FromSQLValue a, FromSQLValue b, FromSQLValue c, Fr
fromSQLRow [a, b, c, d, e] = tuple5 <$> fromSQLValue a <*> fromSQLValue b <*> fromSQLValue c <*> fromSQLValue d <*> fromSQLValue e fromSQLRow [a, b, c, d, e] = tuple5 <$> fromSQLValue a <*> fromSQLValue b <*> fromSQLValue c <*> fromSQLValue d <*> fromSQLValue e
fromSQLRow _ = Nothing fromSQLRow _ = Nothing
instance toSQLValueChar :: ToSQLValue Char where
toSQLValue = toForeign
instance fromSQLValueChar :: FromSQLValue Char where
fromSQLValue = fromRight <<< runExcept <<< readChar
instance toSQLValueString :: ToSQLValue String where instance toSQLValueString :: ToSQLValue String where
toSQLValue = toForeign toSQLValue = toForeign