
{-# RULES "L" LCon1 0 = LCon2
Oh I missed this entirely. You want to write a rule FOR a data constructor???? I thought you just meant one that matches on a data constructor.
That is you want (L 0) to rewrite, all by itself, to LCon2? That had never occurred to me as a possibility. Bizarre.
Let’s not do that.
· GHC does not (knowingly) support it today
· It is a deeply weird thing to do
· If you want to do it, write you own “smart constructor” mkLCon1, that inlines when you say
mkLCon1 x = LCon1 x
{-# INILNE [0] mkLCon1 #-}
{-# RULES “L” mkLCon1 x = LCon2 #-}
Problem solved.
Simon
From: David Feuer [mailto:david.feuer@gmail.com]
Sent: 17 February 2017 00:30
To: Simon Peyton Jones