Comments (8)
The goal is to avoid direct dependency on spire so that it does not block port to Scala 3. Having it be %Test
is not a total avoidance, but it would allow continued testing in Scala 2, and testing in Scala 3 could just use native numeric types to start, plus in-tree Rational
from coulomb.
One option would be to implement a sort of MVP rational that is not necessarily a direct port of spire Rational. As used by coulomb
core, the Rational is compile-time only in the implicit system, so less-than-maximum efficiency is lower impact.
from coulomb.
I guess that is an option. I'm trying to get spire
to run in dotty but I don't have an ETA
from coulomb.
The three main things coulomb currently consumes from spire are:
Rational
ConvertableTo
andConvertableFrom
MultiplicativeGroup
and friends
Rational
would be easy to replace internally. MultiplicativeGroup
and friends are being passed thru from typelevel algebra
. I think the trickiest one to replace would be ConvertableTo
and ConvertableFrom
.
It would be feasible to define a coulomb typeclass for ConvertableTo
and ConvertableFrom
, and simply pass-thru the spire version whereever that was in scope.
My two main concerns with spire
are that (1) it took a long time for spire to get onto scala-2.13, and I hope to not have it block coulomb for scala 3, and (2) spire defines an awful lot of stuff, and I'm only using a couple things.
Regardless of whether it is a hard dependency, I want coulomb to always integrate seamlessly with spire numeric types, for obvious reasons.
from coulomb.
side note: I'm also using shapeless
for ::
and HNil
, which I'm getting transitively from spire
but these types are purely implementation details, and they would be trivial to replace with my own version of ::
and HNil
internally
from coulomb.
cross-ref: over on my scala-3-POC I have an in-tree Rational and fractional exponents:
from coulomb.
my current design concept: coulomb-core will have no dependencies. It will come with coulomb.ops.standard
and coulomb.ops.standard.truncating
rules that cover operations, the new scala.Conversion
and to / toUnit / toValue
There will be separate "tiers" for typelevel algebra, and then additionally spire numeric types.
see for example:
https://github.com/erikerlandson/poc-coulomb-scala3/blob/main/coulomb/src/coulomb/ops/standard.scala
from coulomb.
as of coulomb 0.6.0-M2 we have a separate coulomb-spire package, so I am going to close this
from coulomb.
Related Issues (20)
- scalacheck property testing starting to flake HOT 4
- port build from sbt to mill? HOT 8
- upgrading to sbt 1.5.0 breaks the build HOT 1
- Scalar operations HOT 2
- Snapshot publish failed on scala 3 branch HOT 2
- Scala 3 tests are not running on JS or Native HOT 2
- scala3 questions HOT 5
- mdoc:fail behaving weirdly HOT 5
- Consider supporting Scala Native HOT 4
- Links to source code from API docs not working HOT 9
- DeltaUnit for YearsBC not resolving offset correctly? HOT 8
- Support for millisecond base time unit HOT 1
- 2 Issues: Simplifying and exporting time units HOT 10
- toInstant doesnt compile for millisecond Long timestamp HOT 3
- Documentation tweaks HOT 1
- migrate to s01.oss.sonatype.org HOT 1
- Simplifying coulomb operation signatures HOT 15
- Compiler crash I can't localize
- constant-factor syntax support depends on scala 3.4 (?) HOT 1
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 coulomb.