
19 Mar
2017
19 Mar
'17
12:25 p.m.
On Sun, 19 Mar 2017, amindfv@gmail.com wrote:
Is there a clear way to implement this instance warning? I.e. given:
f x = 2 * length x
Can we guarantee at compile time that "f" will never be passed a 2-tuple?
I gave an idea in the ticket: https://ghc.haskell.org/trac/ghc/ticket/11796 Defining f this way would be ok if x is polymorphic. The warning would only arise if f is applied to a pair.