Did you try giving a type signature to the (entire) case expression, as I suggested?  That should do it.

Perhaps I don't understand the suggestion, but for me the only way I could fix it was to put all the pattern matches into local functions with type signatures.  I can show you the diffs if you would find it useful to see how 'programmers in the wild' react to this.

 

 

I just mean: give a type signature to the entire case expression. Thus

              (case ... of { ...})  ::  type

 

 I’d welcome a way to say that more clearly.


Simon