tdammers / ginger

A Haskell implementation of the Jinja template language.
MIT License
77 stars 13 forks source link

GHC 9 build fails #66

Closed TravisCardwell closed 3 years ago

TravisCardwell commented 3 years ago

The Text.PrintfA module fails to build when using GHC 9.0.1, giving the following error:

     • Couldn't match type ‘t’ with ‘forall r. PrintfType r => r’
       Expected: PrintfTypeT -> t
         Actual: PrintfTypeT -> forall r. PrintfType r => r
       ‘t’ is a rigid type variable bound by
         the type signature for:
           printfa :: forall t. PrintfType t => String -> [PrintfArgT] -> t
         at src/Text/PrintfA.hs:11:1-56
     • In the first argument of ‘(.)’, namely ‘unT’
       In the expression:
         unT . foldl (\ (T r) (P a) -> T $ r a) (T $ printf format)
       In an equation for ‘printfa’:
           printfa format
             = unT . foldl (\ (T r) (P a) -> T $ r a) (T $ printf format)
     • Relevant bindings include
         printfa :: String -> [PrintfArgT] -> t
           (bound at src/Text/PrintfA.hs:12:1)
    |
 12 | printfa format = unT . foldl (\(T r) (P a) -> T $ r a ) (T $ printf format)
    |                  ^^^

This error has to do with simplified subsumption and is easily resolved by using a lambda instead of unT in the implementation of printfa. I will submit a pull request with the fix.

TravisCardwell commented 3 years ago

Thank you!