News for hackers. Stuff that matters.
Re:Two Weeks of Rust by tel on Tuesday January 12, 2016 @08:32AM (#10887259)
You probably also want to complete your toolkit with functions which are then exponentiation.

Also, in any ADT system 0 should be exactly the empty sum and 1 exactly the empty product. This is what makes things hang together properly.

Re:Two Weeks of Rust by _asummers on Tuesday January 12, 2016 @09:40AM (#10887626)
0 and 1 are just idiomatic though, correct? The important part, from my knowledge of abstract algebra, is that there exist an identity for any operation function () such that for all x in your domain, x () identity = x.
Re:Two Weeks of Rust by tel on Tuesday January 12, 2016 @10:01AM (#10887753)
Oh sure, you can call them whatever you like. But if you have an ADT system which has a unit type that isn't quite the empty product then you'll be in for an interesting time at least.

E.g., this is true in Haskell and it causes there to be some "extra structure" which often has to be smoothed over. Lots of library functions exist just to do this smoothing.

Re:Two Weeks of Rust by fanf2 on Thursday January 14, 2016 @11:40AM (#10902434)
And differentiation, which is useful for functional update of persistent data structures. https://chris-taylor.github.io/blog/2013/02/13/the-algebra-o...
Re:Two Weeks of Rust by tel on Thursday January 14, 2016 @04:33PM (#10904669)
That's nice, but I wouldn't call it particularly core to ADT systems. It also requires quite a bit more machinery to embed directly since you need to be able to talk about functors/containers.