Hello GHC HQ, I have been toying with phantom types in combination with "polymorphic" record-updates (which is a great feature imho), but stumbled over a limitation: GHC doesn't allow empty record updates (see toy example below), and I couldn't find a GHC language extension to relax this constraint. In the toy-example below it was easy to workaround by performing a dummy record update, but for more advanced uses workarounds becomes a bit more annoying.
Is there a particular reason why empty record updates are disallowed by the Haskell Report? Would it be sensible, to allow empty record updates as a GHC language extension? hvr. ------------------------------------------------------- -- empty types for tagging data Clean data Dirty data Foo a = Foo { fa :: Int, fb :: String } data Bar a = Bar { ba :: Int, bb :: Foo a } markDirtyFoo :: Foo Clean -> Foo Dirty markDirtyFoo foo = foo { } -- rejected with "Empty record update" error markDirtyFoo foo = foo { fa = fa foo } -- workaround: dummy update markDirtyBar :: Bar Clean -> Bar Dirty markDirtyBar bar = bar { bb = markDirtyFoo (bb bar) } -- works _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users