From 53e20120b26a47f0c80c7a7ace656447357a58f4 Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Sat, 18 May 2013 09:48:27 +0900 Subject: [PATCH] Rename function to get maybe record from SQL. --- DB-record/src/Database/Record/FromSql.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/DB-record/src/Database/Record/FromSql.hs b/DB-record/src/Database/Record/FromSql.hs index 695bca5c..5beb6135 100644 --- a/DB-record/src/Database/Record/FromSql.hs +++ b/DB-record/src/Database/Record/FromSql.hs @@ -18,7 +18,7 @@ module Database.Record.FromSql ( (<&>), - outer, + maybeRecord, FromSql (recordFromSql), recordFromSql', takeRecord, toRecord, @@ -68,11 +68,11 @@ a <&> b = (,) <$> a <*> b infixl 4 <&> -outer :: PersistableType q - => RecordFromSql q a - -> KeyConstraint NotNull a - -> RecordFromSql q (Maybe a) -outer rec pkey = createRecordFromSql mayToRec where +maybeRecord :: PersistableType q + => RecordFromSql q a + -> KeyConstraint NotNull a + -> RecordFromSql q (Maybe a) +maybeRecord rec pkey = createRecordFromSql mayToRec where mayToRec vals | vals !! index pkey /= Persistable.sqlNullValue = (Just a, vals') | otherwise = (Nothing, vals') where @@ -90,7 +90,7 @@ instance (FromSql q a, FromSql q b) => FromSql q (a, b) where instance (HasKeyConstraint NotNull a, FromSql q a, PersistableType q) => FromSql q (Maybe a) where - recordFromSql = outer recordFromSql $ keyConstraint + recordFromSql = maybeRecord recordFromSql keyConstraint instance FromSql q () where recordFromSql = recordFromSql'