Closed andy-morris closed 4 years ago
What this patch does is spit out a warning ("please replace 'newtype' with 'data'") on a newtype and continue as if it was a (strict) datatype. Other options I can think of offhand are to silently do this without warning, or to make the warning into a more descriptive error and stop.
It would be great if this were a flag somehow, but I think a warning by default is fine, as long as you mention the ofending newtype
. The flag would be able to demote or promote the warning to nothikng or an error respectively.
@mariari I added a flag for extensibleWith
, which for extensible
defaults to a warning
Fixes #14.
What this patch does is spit out a warning ("please replace 'newtype' with 'data'") on a newtype and continue as if it was a (strict) datatype. Other options I can think of offhand are to silently do this without warning, or to make the warning into a more descriptive error and stop.
Which do you think this is the more intuitive behaviour @mariari?
This PR also replaces the error
"not a datatype"
to show the offending declaration. It still doesn't show a correct line number because TH doesn't let me do that. :(