Illegal tuple section [GHC-59155]

One of the components in a tuple is missing, but the TupleSections GHC extension has not been enabled. Perhaps this is a typo? If not, and the use of the tuple section syntax is intentional, please enable the extension, for example by adding the following line:

{-# LANGUAGE TupleSections #-}

at the top of your file.

Please refer to the TupleSections section page of the GHC user guide to learn more about tuple sections.

Examples

Illegal tuple section

Error message

IllegalTupleSection.hs:6:7: error: [GHC-59155]
    Illegal tuple section
    Suggested fix:
      Perhaps you intended to use the ‘TupleSections’ extension
  |
6 | foo = (1,)
  |       ^^^^
IllegalTupleSection.hs
Before
{-# LANGUAGE Haskell2010 #-}
-- TupleSections not enabled

module IllegalTupleSection where

foo = (1,)

After
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TupleSections #-}

module IllegalTupleSection where

foo = (1,)
Illegal unboxed tuple section

Error message

IllegalTupleSection.hs:7:7: error: [GHC-59155]
    Illegal tuple section
    Suggested fix:
      Perhaps you intended to use the ‘TupleSections’ extension
  |
7 | foo = (# 1, #)
  |       ^^^^^^^^
IllegalUnboxedTupleSection.hs
Before
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE UnboxedTuples #-}
-- TupleSections not enabled

module IllegalUnboxedTupleSection where

foo = (# 1, #)

After
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE TupleSections #-}

module IllegalUnboxedTupleSection where

foo = (# 1, #)