[Haskell-cafe] Useful IDE features - "implement instance"

Bulat Ziganshin bulat.ziganshin at gmail.com
Tue Jun 19 02:38:47 EDT 2007


Hello peterv,

Monday, June 18, 2007, 6:44:06 PM, you wrote:
> Just another wild idea which I might find useful, but is more like
> refactoring, is to convert the fields of a record to get/set type-classes,
> and refactor all usages of those fields.

i never done such refactoring. just use different names for fields. a
rule of thumb is including of record name in field names:

data PackedFilePath = PackedFilePath
  { fpPackedDirectory       :: !MyPackedString
  , fpPackedBasename        :: !MyPackedString
  , fpLCExtension           :: !String
  , fpHash   :: {-# UNPACK #-} !Int32
  , fpParent                :: !PackedFilePath
  }                                                 
  | RootDir                                         

data FileInfo = FileInfo
  { fiFilteredName         :: !PackedFilePath  
  , fiDiskName             :: !PackedFilePath  
  , fiStoredName           :: !PackedFilePath  
  , fiSize  :: {-# UNPACK #-} !FileSize        
  , fiTime  :: {-# UNPACK #-} !FileTime        
  , fiIsDir :: {-# UNPACK #-} !Bool            
  }                                            

  


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



More information about the Haskell-Cafe mailing list