These are chat archives for non/algebra

12th
Jan 2016
Lars Hupel
@larsrh
Jan 12 2016 11:17
Let's say I have a function with type parameter A : Rig : Rng (okay, that's a bad example) and in there, I'm calling a function with type parameter A : Semiring. What's the preferred approach in algebra to avoid the ambiguity error?
Denis Rosset
@denisrosset
Jan 12 2016 13:00
@rklaehn that's great! I don't have the time for implement this algorithm yet, but I'm following your blog now. For metal: I'm using Long because this enables larger structures, for example by allocation 2^n arrays of 2^31 elements, and using the bits in the Long in a clever way. Also: usage for off-heap data structures.
Erik Osheim
@striation
Jan 12 2016 14:10
@larsrh if you have Rig[A] and Rng[A] then you should be able to have Ring[A] right?
is there a reason that you require both separately and not just A: Ring
Miles Sabin
@milessabin
Jan 12 2016 16:53
And now I have a Rip, Rig and Panic earworm ... could be worse ...
Lars Hupel
@larsrh
Jan 12 2016 21:59
@striation That's why I said it's a bad example. This is a scenario where code is generated (from Isabelle), and our typeclass hierarchy is much more fine granular and these situations occur often
Lars Hupel
@larsrh
Jan 12 2016 22:29
Better example, maybe: having Ord[A] and Hash[A] in scope, but requiring Eq[A].