<div dir="ltr"><div>GHC 8.2.2 and 8.4.3 dislike the following rules:</div><div><br></div><div>``` haskell</div><div>{-# RULES</div><div><br></div><div>"pair fst snd" forall p. (,) (exl p) (exr p) = p</div><div><br></div><div>"swap" forall p. (,) (exr p) (exl p) = swap p</div><div><br></div><div> #-}</div><div>```</div><div><br></div><div>Error messages:</div><div><br></div><div>``` haskell</div><div>/Users/conal/Haskell/concat/plugin/src/ConCat/Rebox.hs:485:1: warning:</div><div>    A constructor, (,), appears as outermost match in RULE lhs.</div><div>    This rule will be ignored.</div><div>    |</div><div>485 | "pair fst snd" forall p. (,) (exl p) (exr p) = p</div><div>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div><div><br></div><div>/Users/conal/Haskell/concat/plugin/src/ConCat/Rebox.hs:489:1: warning:</div><div>    A constructor, (,), appears as outermost match in RULE lhs.</div><div>    This rule will be ignored.</div><div>    |</div><div>489 | "swap" forall p. (,) (exr p) (exl p) = swap p</div><div>    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div><div>```</div><div><br></div><div>GHC 8.0.2 didn't complain about these rules, though I'm unsure whether they worked as desired.</div><div><br></div><div>Why disallow such rules (with constructors at the head)?</div><div><br></div><div>-- Conal</div><div><br></div></div>