template-haskell-2.16.0.0 changes its treatment of tuples in two ways, and these both affect free:
The type of TupE has changed from [Exp] -> Exp to [Maybe Exp] -> Exp as it now has the ability to support tuple sections. As a result, free's use of TupE requires some CPP to adapt to the new type.
TupE [x] now generates a unary tuple value instead of simply dropping the parentheses and generating x. To achieve consistent results across all versions of template-haskell, I deliberately avoid generating unary tuples to restore the old behavior on template-haskell-2.16 and above.
template-haskell-2.16.0.0
changes its treatment of tuples in two ways, and these both affectfree
:TupE
has changed from[Exp] -> Exp
to[Maybe Exp] -> Exp
as it now has the ability to support tuple sections. As a result,free
's use ofTupE
requires some CPP to adapt to the new type.TupE [x]
now generates a unary tuple value instead of simply dropping the parentheses and generatingx
. To achieve consistent results across all versions oftemplate-haskell
, I deliberately avoid generating unary tuples to restore the old behavior ontemplate-haskell-2.16
and above.Thanks to Alan Zimmerman for originally noticing this in https://gitlab.haskell.org/ghc/ghc/issues/17371. I have adapted his corresponding
head.hackage
patch from https://gitlab.haskell.org/ghc/head.hackage/merge_requests/45.