[Hugs-users] Record puns, time for removal?

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Oct 30 16:20:58 EST 2006


Hello Simon,

Monday, October 30, 2006, 3:11:23 PM, you wrote:

> I always thought it was a mistake to remove record puns in H98.  I would
> not be against re-introducing them into GHC, since they appear to remain
> in Hugs and are in Yhc.

what you (and all) think about wildcarded puns:

data Command = Command {
    cmd_name                 :: !String             
  , cmd_arcspec              ::  String             
  , cmd_arclist              ::  [FilePath]         
  , cmd_arcname              ::  FilePath           
  , cmd_arc_filter           :: !(FileInfo -> Bool) 
  , cmd_filespecs            :: ![String]           
  , cmd_added_arcnames       :: !(IO [FilePath])    
  , cmd_diskfiles            :: !(IO [FileInfo])    
  , cmd_subcommand           :: !Bool               
....
}

process_cmd (Command{*}) = do
   print cmd_name
   ...

because Haskell encourage using of structure name as part of field's
name, this will not create mess (at least for my programs), it will
work like Pascal's 'with' operator



-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-prime mailing list