brendanhay/gogol

Design question: newtypes

Closed this issue · 2 comments

Hey there!

I'm taking gogol for a spin. I'm a long time amazonka user and noticed that theres some departers from the amazonka design. In particular, in amazonka, things like BucketName are a newtype over text which I really like because it helps prevent you from mixing up something that's semantically a BucketName with one of the most ubiquitous types. I noticed in gogol-storage its just a Text. I'm curious if this was a conscious decision and if so, why?

It's unfortunately something that propagates directly from the service definitions and the generator's interpretation of, as opposed to a concious decision. Additionally some of the newtypes present in amazonka have been retroactively added over time whereas gogol hasn't seen the same amount of attention.

I currently have some changes in the works which unify the generation steps of both library suites and should make things like this much more consistent + easier to layer on if absent from the definitions.

Makes sense. I figured it would be something like that. As long as you're amenable to updates and there's a sensible way to customize the types beyond what is generated from the docs, I think its a good position to be in. We're still investigating google cloud but if we end up using it I'll probably be looking at implementing some improvements.