wreq icon indicating copy to clipboard operation
wreq copied to clipboard

Various changes to enable cross-compilation

Open georgefst opened this issue 3 years ago • 3 comments

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-lens over TH? And perhaps some different approach to doctests which doesn't require a custom setup.

georgefst avatar Apr 15 '22 16:04 georgefst

Open to any suggestions :) If you make a PR that make things better... The doctests are a little annoying, yes... I'd think generic-lens would be fine, I guess the problem with cross-compilation is TH?

ondrap avatar Apr 17 '22 16:04 ondrap

I mentioned some of this in the commit message, in case you missed it.

The doctests are a little annoying, yes...

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.

I'd think generic-lens would be fine

Ok, I'll see if I can put up a more polished PR for that.

I guess the problem with cross-compilation is TH?

Indeed.

georgefst avatar Apr 24 '22 10:04 georgefst

I'd think generic-lens would be fine

Ok, I'll see if I can put up a more polished PR for that.

I've taken a stab at this in https://github.com/georgefst/wreq/commit/032d5560a6add2a624c075631f0c90660b5c90db, but there are several caveats, outlined in the commit message.

All can ultimately be overcome. Though one would require a small upstream change (https://github.com/snoyberg/http-client/issues/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.

georgefst avatar May 02 '22 22:05 georgefst