Unsaturated applications of runRW# are rejected
46720997 recently enabled simplification of
runRW# and in the process gave it a few more special properties. Among these is a Core Lint check which rejects any unsaturated applications of
runRW#. However, this is problematic as such applications can occur in real code. For instance, the desugared Core of
Data.Primitive.Array.runArray# from the
primitive package contains:
case ($) (runRW# @_ @_) (\s -> ...) of ...
Clearly this link check is too strict. That's not all: CorePrep also has a check which panics on unsaturated applications.
However, I don't believe either of these checks are necessary.
runRW# has a perfectly reasonable Haskell binding which will get called if we produce code for the unsaturated application in the normal way. I suggest that we just eliminate both checksl