It's a GHC issue that shows that Statistics.Sample.Histogram is very delicately balanced indeed, on the way GHC infers types for nested bindings, with local equality constraints and type families.
It is easy to make it robust: just add type signatures as described in the above ticket. Moreover, it makes the code a lot easier to understand.
@Shimuuar could I invite you to look at https://gitlab.haskell.org/ghc/ghc/-/issues/23224
It's a GHC issue that shows that Statistics.Sample.Histogram is very delicately balanced indeed, on the way GHC infers types for nested bindings, with local equality constraints and type families.
It is easy to make it robust: just add type signatures as described in the above ticket. Moreover, it makes the code a lot easier to understand.
Could you possibly do that? Thanks!