reflex-platform
reflex-platform copied to clipboard
problems when using makeLenses from Control.Lens.TH
I'm trying to use makeLenses from Control.Lens.TH in a reflex-platform based project. I am using a very recent version of the reflex platform. When I include even a very simple example of using makeLenses, the build fails with this error (at the stage where GHCJS is linking Template Haskell):
Data.Binary.Get.runGet at position 1: Unknown encoding for constructor
CallStack (from HasCallStack):
error, called at libraries/binary/src/Data/Binary/Get.hs:351:5 in binary-0.8.5.1:Data.Binary.Get
Here's a minimal example that fails in this way:
{-# LANGUAGE TemplateHaskell #-}
module SomeModule where
import Control.Lens
import Control.Lens.TH
data SomeType = SomeType { _someField :: Int }
$(makeLenses ''SomeType)
@dktr0 What operating system are you using? A binary encoding issue sounds like it could be system-level, though I'm not sure how makeLenses
could cause it.
Will have to check again since it's been a while - but my recollection is that this was probably happening on multiple OSes - Debian and OSX for example. Will try again though if you are confirming that it should be possible to use this. Thanks!
I know there have been issues using Template Haskell with ghcjs in the past, but the critical ones should be resolved now, and uses like makeLenses
should definitely be possible. Let me know if it's still an issue and I'll investigate further if so.
I just had the chance to check - still get the same error on both Debian 10 and OS X 10.14. This is using commit 6f73628ec6091b5b352ad7d224bf34cb0cb162ed of reflex-platform.
If anyone encounters this issue, please reopen.