hah i actually loaded up the “counterexample” in ghci
and toggled NoMonomorphismRestriction
as requested and as expected -Wtype-defaults
called the code out as suspicious.
horrific-implicit-params-example.hs:7:24: error: [GHC-18042] [-Wtype-defaults, Werror=type-defaults]
• Defaulting the type variable ‘t0’ to type ‘Integer’ in the following constraint
Num t0 arising from the literal ‘456’
• In the expression: 456
In the expression: let ?myparam = 456 in result
In the expression: (result, let ?myparam = 456 in result)
so that is definitely Bad Code but not due to -XImplicitParams
.
like i said - evaluate code on its own merits instead of trying to find global rules handed down by blog posts