Skip to content

Instantly share code, notes, and snippets.

@benkolera
Created September 1, 2015 06:15
Show Gist options
  • Select an option

  • Save benkolera/ce98341861791d1399de to your computer and use it in GitHub Desktop.

Select an option

Save benkolera/ce98341861791d1399de to your computer and use it in GitHub Desktop.
class PGHasTimestamp a where
instance PGHasTimestamp PGDate
instance PGHasTimestamp PGTimestamp
instance PGHasTimestamp PGTimestamptz
class PGHasDate a where
instance PGHasDate PGDate
instance PGHasDate PGTimestamp
instance PGHasDate PGTimestamptz
now :: PGHasTimestamp a => Column a
now = C.Column (HPQ.FunExpr "now" [])
date :: PGHasDate a => Column a -> Column PGDate
date a = C.Column (HPQ.FunExpr "date" [C.unColumn a])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment