[GHC] #15855: Warn about incomplete NamedFieldPuns patterns

GHC ghc-devs at haskell.org
Sat Nov 3 16:02:29 UTC 2018


#15855: Warn about incomplete NamedFieldPuns patterns
-------------------------------------+-------------------------------------
        Reporter:  Artyom.Kazak      |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Artyom.Kazak):

 A more concrete example:

 {{{#!haskell
 -- Handler for POST /update/info
 updateInfo :: UpdateInfo -> Handler ()
 updateInfo u = do
   mapM_ setTitle (updateTitle u)
   mapM_ setDate (updateDate u)

 -- | Auxiliary data structure used by the handler.
 --
 -- NB: Don't forget to update 'updateInfo' when adding fields here
 data UpdateInfo = UpdateInfo
   { updateTitle :: Maybe Text
   , updateDate :: Maybe UTCTime
   }

 instance FromJSON UpdateInfo
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15855#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list