Comments (3)
Eq
and Hash
are lawful and useful to algebraic code. I wish scala had a Show typeclass, but I'd tend say we should not have it here. You have a barrier against the slippery slope: adding only typeclasses implied by Object, but still I'm weakly opposed.
Next, other than style, I'm not sure what is that bad about .toString. I mean, I would not design a new language with .toString on everything, but given that Java and scala already did that, I'm not sure the win of having Show other style purity.
from algebra.
I see your point of view.
About why having Show: often implementing toString requires access to typeclass instances. So you have to capture the typeclass instances into your data structures in order to implement toString, which is inefficient, and also drives you to a more OO design.
from algebra.
Yeah - a good point. I don't think toString
is too bad, but an example in Spire is that we often have to use this really nasty hack to work with generic values when we don't have a type class available to help us. This shows up more when implementing equals
and many of the ScalaNumber
methods :\
That said, I'd rather not have Show
here as well.
from algebra.
Related Issues (20)
- add Kleene Algebra HOT 1
- fromInt and Ring-like structures.
- ConicMonoid: when values are always increasing. HOT 10
- Publish a version for cats 0.8.0 HOT 1
- cast class exception using algebra with algebird HOT 1
- Annihilator -- Structure with element that "annihilates" any other element of the set HOT 3
- Add tests for the functions in companion objects of the types. HOT 1
- Publish 0.7.0 to address binary incompatibility HOT 1
- Algebra Syntax (was #78 Symbolic Infix Operators)
- link to docs is broken HOT 5
- Why don't we move Spire's Module/VectorSpace/MetricSpace/etc. here? HOT 3
- Possible compatibility breaking change in cats-kernel HOT 1
- Upgrade to Cats RC1 HOT 2
- Law testing guidelines HOT 1
- Broken links in README.md HOT 2
- Integrating cats.kernel.Semigroup and friends HOT 30
- publish for Scala 2.13.0-M5 HOT 26
- publish for Scala 2.13 HOT 1
- Integrate intermediate steps between `CommutativeRing` and `Field` HOT 1
- Archive this repo? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from algebra.