I was trying to use record update for an existential record when I ran into an error. A quick google led me to feature request #2595, which shows it as implemented for GHC back in version 6.8.3. I'm using 6.10.4, so I'd think it should work, but the example code from the feature request:
{-# LANGUAGE ExistentialQuantification,Rank2Types #-}
module Foo where
data Foo = forall a . Foo { foo :: a -> a, bar :: Int }
x :: Foo
x = Foo { foo = id, bar = 3 }
f :: Foo -> Foo
f rec = rec { foo = id }
g :: Foo -> Foo
g rec = rec { bar = 3 }
yield the same errors as complained of in the feature request:
test.hs:10:8:
Record update for the non-Haskell-98 data type `Foo' is not (yet) supported
Use pattern-matching instead
In the expression: rec {foo = id}
In the definition of `f': f rec = rec {foo = id}
test.hs:13:8:
Record update for the non-Haskell-98 data type `Foo' is not (yet) supported
Use pattern-matching instead
In the expression: rec {bar = 3}
In the definition of `g': g rec = rec {bar = 3}
Was this a consciously dropped feature at some point, or should I file a bug report?