postgresql-simple
postgresql-simple copied to clipboard
Applicative instance for Only
This would be useful to do fmap join . sequenceA . listToMaybe on a query which normally returns [Only (Maybe a)]. With the magic sequence this becomes Only (Maybe a).
Or, to golf more, join . fromOnly . sequenceA . listToMaybe to get Maybe a.
Only is defined in http://hackage.haskell.org/package/Only package