Last active
August 29, 2015 14:01
-
-
Save khibino/776c25d1470594aaf241 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MyTuple | |
import Control.Applicative | |
import Database.Record | |
import Database.Record.ToSql | |
import Database.Relational.Query | |
import Database.HDBC (SqlValue) | |
import Database.HDBC.Query.TH | |
instance ProductConstructor (a -> b -> c -> MyTuple a b c) where | |
productConstructor = MyTuple | |
instance (FromSql SqlValue a, FromSql SqlValue b, FromSql SqlValue c) | |
=> FromSql SqlValue (MyTuple a b c) where | |
recordFromSql = MyTuple <$> recordFromSql <*> recordFromSql <*> recordFromSql | |
instance (ToSql SqlValue a, ToSql SqlValue b, ToSql SqlValue c) | |
=> ToSql SqlValue (MyTuple a b c) where | |
recordToSql = createRecordToSql (\(MyTuple a b c) -> fromRecord a ++ fromRecord b ++ fromRecord c) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment