diff --git a/scripts/hpc-ratchet b/scripts/hpc-ratchet index 4eeace0..1800f6f 100755 --- a/scripts/hpc-ratchet +++ b/scripts/hpc-ratchet @@ -37,9 +37,9 @@ Each item represents the number of "things" we are OK with not being covered. COVERAGE_TOLERANCE = { ALTERNATIVES: 161, BOOLEANS: 8, - EXPRESSIONS: 1416, + EXPRESSIONS: 1413, LOCAL_DECLS: 14, - TOP_LEVEL_DECLS: 669, + TOP_LEVEL_DECLS: 666, } diff --git a/src/GraphQL/Internal/API/Enum.hs b/src/GraphQL/Internal/API/Enum.hs index 647f7de..1043aff 100644 --- a/src/GraphQL/Internal/API/Enum.hs +++ b/src/GraphQL/Internal/API/Enum.hs @@ -86,24 +86,16 @@ instance forall conName p b. (KnownSymbol conName) => GenericEnumValues (C1 ('Me -- TODO(tom): better type errors using `n`. Also type errors for other -- invalid constructors. -instance forall conName p b sa sb. - ( TypeError ('Text "Constructor not unary: " ':<>: 'Text conName) +instance forall conName f s sa sb. + ( TypeError ('Text "Constructor not nullary: " ':<>: 'Text conName) , KnownSymbol conName - ) => GenericEnumValues (C1 ('MetaCons conName p b) (S1 sa sb)) where - genericEnumValues = nonUnaryConstructorError - genericEnumFromValue = nonUnaryConstructorError - genericEnumToValue = nonUnaryConstructorError - -instance forall conName p b sa sb f. - ( TypeError ('Text "Constructor not unary: " ':<>: 'Text conName) - , KnownSymbol conName - ) => GenericEnumValues (C1 ('MetaCons conName p b) (S1 sa sb) :+: f) where + ) => GenericEnumValues (C1 ('MetaCons conName f s) (S1 sa sb)) where genericEnumValues = nonUnaryConstructorError genericEnumFromValue = nonUnaryConstructorError genericEnumToValue = nonUnaryConstructorError nonUnaryConstructorError :: a -nonUnaryConstructorError = panic "Tried to construct enum with non-unary constructor. Should get a compile-time error instead of this." +nonUnaryConstructorError = panic "Tried to construct enum with non-nullary constructor. Should get a compile-time error instead of this." -- | For each enum type we need 1) a list of all possible values 2) a -- way to serialise and 3) deserialise.