News for hackers. Stuff that matters.
Re:Pitfalls in Haskell by dllthomas on Monday August 22, 2016 @11:24AM (#12336949)
Technically 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.
Re:Pitfalls in Haskell by taylorfausak on Monday August 22, 2016 @11:56AM (#12337203)
That'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’