Linear types: type inference in Typed Template Haskell
The following module should compile, but it doesn't:
{-# LANGUAGE TemplateHaskell, LinearTypes #-}
module Bug where
import Language.Haskell.TH
idenq :: Quote m => Code m (a #-> a)
idenq = [|| \x -> x ||]
• Couldn't match type ‘'Many’ with ‘'One’
Expected: Code m (a #-> a)
Actual: Code m (a -> a)
The workaround is [|| (\x -> x) :: a #-> a ||]
.
Originally reported at !852 (comment 280765).