Various changes to enable cross-compilation#147
Various changes to enable cross-compilation#147georgefst wants to merge 1 commit intohaskell:masterfrom
Conversation
…rpreter`) As it stands, we also need changes to `entropy`, but I'll manage that separately. Hopefully by reviving haskell/entropy#20. Note that the custom setup is only used for `cabal-doctest`, so we really can just safely remove it. This is essentially the same issue as cdepillabout/pretty-simple#82. Seeing as all the TH is just for `makeLenses`, in an ideal world we really ought to just be able to run on the host: see ghc-proposals/ghc-proposals#243. The changes to the two `.hs` files are from dumping the TH splices (and manually (well, with _some_ help from HLS) adding a load of qualified imports). The splices can be found in `dist-newstyle` after adding this to `cabal.project`: ``` package wreq ghc-options: -ddump-splices -dth-dec-file ```
|
Open to any suggestions :) If you make a PR that make things better... |
|
I mentioned some of this in the commit message, in case you missed it.
Yeah, the doctest situation in Haskell is a (possibly improving?) mess. I've lost track of best practice. It's a bit mad that we have a situation where tests which we don't actually run can make a library harder to compile.
Ok, I'll see if I can put up a more polished PR for that.
Indeed. |
I've taken a stab at this in georgefst@032d556, but there are several caveats, outlined in the commit message. All can ultimately be overcome. Though one would require a small upstream change (snoyberg/http-client#451). Regardless, I'm not inclined to return to this in the near future. It's also still fairly verbose, and might be no more maintainable in practice then writing the instances by hand instead. |
Obviously this isn't mergeable in its current state. But I figured I'd leave it here as a draft in case anyone else wants to cross-compile this library.
In the longer run, would you consider using
generic-lensover TH? And perhaps some different approach to doctests which doesn't require a custom setup.