other postgres string types #4

Closed
pheaver opened this Issue Jan 8, 2012 · 5 comments

Projects

None yet

2 participants

@pheaver

There are many postgres string types (I'm dealing with the cidr and uuid types right now) with no Result instance in postgresql-simple, and defining one is tedious.

One solution is to extend okText to include them, so that the user can just read them as String, ByteString, or Text.

Or, if you export the compat, mkCompats, and doConvert functions (and make them more user friendly), it would be a lot easier to define one's own instance of Result for types like cidr and uuid.

@lpsmith
Owner
@pheaver

Hmm, there's more than one UUID package, and I'm not sure if there's a good package for representing CIDR.

@lpsmith
Owner
@pheaver

I ended up going with http://hackage.haskell.org/package/network-address, and I'm happy with it.

@lpsmith
Owner

Glancing at that package, it looks like a reasonable start. There are a few things I don't like about it, especially it's abuse of the "Read" type class. (Which, in all honesty, probably isn't as bad as the nearly ubiquitous abuse of the "Show" typeclass)

Like I said, I am very much interested in supporting these types out-of-box, so if you find/write a particularly nice UUID or network address library (maybe by using network-address as a starting point), then I'd love to add Result instances for them to postgresql-simple.

@lpsmith lpsmith closed this Jan 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment