mrkkrp / modern-uri

Modern library for working with URIs
Other
68 stars 18 forks source link

Use newtypes instead of `RText` #11

Closed mitchellwrosen closed 6 years ago

mitchellwrosen commented 6 years ago

Hi, would you accept a patch that replaces the RText machinery with a bunch of newtypes? i.e.

newtype Scheme = Scheme { unScheme :: Text }
newtype Host = Host { unHost :: Text }
... etc ...

I think it would make the library a bit friendlier to beginners :)

mrkkrp commented 6 years ago

I think it would make the library a bit friendlier to beginners :)

Maybe, but at this point I'd rather prefer to keep the API stable than to change it. The current approach allows a bit nicer organization of code and a single unRText function for unwrapping. I'm not entirely convinced that indexing by types obtained with DataKinds vs simple newtypes makes a big difference for beginners.

mitchellwrosen commented 6 years ago

Sounds good. I'll close this issue out.