Skip to content

Support empty record update syntax

Empty record update syntax would be useful for when you are changing phantom type parameters. It is currently explicitly disallowed, but it isn't clear if that is absolutely necessary to me.

data R phantom = C { a,b :: Int }

r ::  R Int 
r = C 1 2 

--This is OK
r1 :: R Char
r1 = r { a = a r } 

--Why not this?
r2 :: R Char
r2 = r {}
Trac metadata
Trac field Value
Version 7.6.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information