[GHC] #7658: Support empty record update syntax

#7658: Support empty record update syntax -----------------------------+---------------------------------------------- Reporter: glguy | Owner: Type: feature request | Status: new Priority: normal | Component: Compiler Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- 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 {} }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7658 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7658: Support empty record update syntax -----------------------------+---------------------------------------------- Reporter: glguy | Owner: Type: feature request | Status: new Priority: normal | Component: Compiler Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by glguy): I guess this would cause a problem typing expressions like: {{{ \x -> x{} }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7658#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7658: Support empty record update syntax -----------------------------+---------------------------------------------- Reporter: glguy | Owner: Type: feature request | Status: new Priority: normal | Component: Compiler Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by monoidal): Shameless plug: Personally I like to allow changing phantom type parameters with the same mechanism as newtype coercions, described [http://hackage.haskell.org/trac/ghc/wiki/NewtypeWrappers here] and [http://markmail.org/message/ty2xrzenuyyap6wj#query:+page:1+mid:ty2xrzenuyyap... here]. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7658#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7658: Support empty record update syntax -------------------------------+-------------------------------------------- Reporter: glguy | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.2 Resolution: wontfix | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by simonpj): * status: new => closed * difficulty: => Unknown * resolution: => wontfix Comment: glguy is right: the typing of record updates currently depends critically on there being at least one field. What type would you infer for this? {{{ f x = x {} }}} I agree about newtype wrapper. Very much on the radar. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7658#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC