[GHC] #12376: Allow function definitions in record syntax

GHC ghc-devs at haskell.org
Fri Oct 7 04:52:50 UTC 2016


#12376: Allow function definitions in record syntax
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.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 ezyang):

 It's worth mentioning that you can almost directly simulate the desired
 syntax here using record wildcards:

 {{{
 propertyMap :: (Monad m, Ord k) => v -> PropertyMap m k v
 propertyMap v0 = go v0 Map.empty where
   go v m = PropertyMap{..}
     where
       getP k    = return $ maybe v id (Map.lookup k m)
       putP k v' = return $ go v (Map.insert k v' m)
 }}}

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


More information about the ghc-tickets mailing list