Closed jml closed 7 years ago
Looking at commits looks fine but would prefer to see rebase on other branch if you have time.
It has been rebased? On Sat, 17 Dec 2016 at 16:28, teh notifications@github.com wrote:
Looking at commits looks fine but would prefer to see rebase on other branch if you have time.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jml/graphql-api/pull/26#issuecomment-267771727, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHq6pjraEaNl3hcj4dDyRtciBsggoziks5rJA2ogaJpZM4LP6m2 .
Or I guess approve #24 and I can rebate on master after merging. On Sat, 17 Dec 2016 at 17:58, Jonathan Lange jml@mumak.net wrote:
It has been rebased? On Sat, 17 Dec 2016 at 16:28, teh notifications@github.com wrote:
Looking at commits looks fine but would prefer to see rebase on other branch if you have time.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jml/graphql-api/pull/26#issuecomment-267771727, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHq6pjraEaNl3hcj4dDyRtciBsggoziks5rJA2ogaJpZM4LP6m2 .
Sorry about rebase. Had a brain fart. Done now.
Also removed the IsString
instance from Name
, as it was allowing constructing invalid names. We could re-introduce it and have it panic, which wouldn't be so bad as it would only ever be called on literals. I thought about that and thought that probably it would be less surprising for users if they had to be explicit about it.
The quest to remove TODOs never ends. Although this removes one, it makes another.
Builds on https://github.com/jml/graphql-api/pull/24, so review & merge that before reviewing this (or just review https://github.com/jml/graphql-api/pull/26/commits/ddbd8afbb4723f15236a039618a09a925cec0946).
Was going to do QuickCheck instances in this as per #23 but this turned out to be more complicated than expected and also now I really have to go.
Smart constructor for Name
Name is restricted in value, so when we have something that accepts a
Name
as a parameter, it should be able to trust that it's valid.Stopped exporting
Name
constructor and now export two constructors:makeName
unsafeMakeName
They do what they say on the tin.
There are three use-cases for
unsafeMakeName
:Definitions
, because we cannot get GHC to enforce a restricted set of values for aSymbol
.TypeApi
, because we're operating on Data.GraphQL.AST directly when we should be operating on a pre-restricted type. Noted as a TODO comment.I tried adding a
HasName
type class toDefinitions
, but couldn't figure it out in the ten minutes I gave myself.Misc cleanups