clash-lang / clash-compiler

Haskell to VHDL/Verilog/SystemVerilog compiler
https://clash-lang.org/
Other
1.41k stars 150 forks source link

`OverridingBool` prevents auto derivation of various classes #2754

Closed martijnbastiaan closed 1 month ago

martijnbastiaan commented 1 month ago

See https://github.com/clash-lang/clash-compiler/pull/2711#discussion_r1670894452. We could remove a whole bunch of code if we were to define our own (isomorphic) version of OverridingBool.

leonschoorl commented 1 month ago

We use the OverridingBool because we have to pass it to GHC's api here, possibly in other places too.

Instead of defining our own version and converting from/to GHC's version, we could also just derive the required (orphan) instances for OverridingBool.

martijnbastiaan commented 1 month ago

I don't think that's a good idea. Orphan instances break everyone's code that had the same idea.