You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the advice from the comments in the StackOverflow, I am making use of uncurry4 function like below to map to a record:
uncurry4 func (a, b, c, d) = func a b c d
getEmailConfig::PGConnection->IO [EmailConfig]
getEmailConfig conn =do
result <- pgQuery conn selectEmailQ
pure$map (uncurry4 EmailConfig) result
So, I wonder if this is a correct/idiomatic way of doing the mapping of result to a Haskell record? Or, is there some other better way of achieving this? I looked at the Database.PostgreSQL.Typed.Relation module but I don't think it is meant for this purpose.
The text was updated successfully, but these errors were encountered:
Haskell newbie trying to understand how I can get this to work. I have a record defined like this:
When I execute the SQL query like following, I wish to map it to a record.
Following the advice from the comments in the StackOverflow, I am making use of
uncurry4
function like below to map to a record:So, I wonder if this is a correct/idiomatic way of doing the mapping of result to a Haskell record? Or, is there some other better way of achieving this? I looked at the Database.PostgreSQL.Typed.Relation module but I don't think it is meant for this purpose.
The text was updated successfully, but these errors were encountered: