Closed mfussenegger closed 3 years ago
Thanks for the report. It turns out, given that file, {-# LANGUAGE TypeFamilies #-}
alone also makes it fail - nothing to do with RecordDotPreprocessor, other than the fact it happens to use TypeFamilies under the hood. I suggest you turn on TypeFamilies, and fix the errors. And the error is likely to be that TypeFamilies made the function lookup
become monomorphic - give it a polymorphic type signature and you should be fine.
Oh that was quick. Thank you for taking the time to look into this.
- give it a polymorphic type signature and you should be fine.
That worked 👍
I wasn't aware that TypeFamilies
would have this effect. I guess it's time for me to learn more about that extension.
First of all, thanks for this and the work on the
RecordDotSyntax
proposal.I wanted to use this in a project and after adding the preprocessor I get a compile error that I can't explain. I tried to create a minimal reproduction:
With the
{-# OPTIONS_GHC -F -pgmF=record-dot-preprocessor #-}
this fails with type check errors:When
{-# OPTIONS_GHC -F -pgmF=record-dot-preprocessor #-}
is removed the code compiles.I'm using ghc 8.10.4 and installed the
record-dot-preprocessor
usingstack install record-dot-preprocessor