3 ms·
Using the same record field name in different records: https://downloads.haskell.org/~ghc/master/users-guide/8.0.1-notes.html https://downloads.haskell.org/~gh
by hellofunk 10y ago
Using the same record field name in different records:
https://downloads.haskell.org/~ghc/master/users-guide/8.0.1-notes.html https://downloads.haskell.org/~ghc/master/users-guide/8.0.1-...
- dllthomas 10y agoTechnically the complaint here was of the same record field name in different constructors for the same record, which is perfectly allowed when the fields in question have the same type but not when the types differ. I don't think DuplicateRecordFields addresses this.
- taylorfausak 10y agoThat's correct. {-# LANGUAGE DuplicateRecordFields #-} data A = B { x :: Bool } | C { x :: Int } Example.hs:2:1: error: • Constructors B and C give different types for field ‘x’ • In the data type declaration for ‘A’