[Haskell-cafe] toSql and fromSql, for Algebraic Data Type

Tom Murphy amindfv at gmail.com
Sat Jun 25 02:02:12 CEST 2011


Hi *,
     The title is self-explanatory. I'd like to store information from
an algebraic data type in an SQL database, but the type signature of
toSql (toSql
  :: Data.Convertible.Base.Convertible a SqlValue => a -> SqlValue)
doesn't make sense to me.
     How is this done (how do I make an instance of a typeclass like that?)

Thanks for your time,
Tom



More information about the Haskell-Cafe mailing list