You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spire will support Scala 3 since `v0.18.0` and `v0.18.0-M1` is a pre-release including breaking changes toward 0.18.0. For more detail, visit [Release Note](https://github.com/typelevel/spire/releases/tag/v0.18.0-M1).
4
-
5
-
Since v0.18.0, we track changes in [github releases page](https://github.com/typelevel/spire/releases).
6
3
## Version 0.16.1-SNAPSHOT
7
4
8
5
* Disabled benchmarked depending on Caliper; waiting for migration to a modern benchmarking framework
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-17
Original file line number
Diff line number
Diff line change
@@ -13,22 +13,11 @@ We also gladly accept patches for documentation. Anything from fixing
13
13
a typo to writing a full tutorial is a great way to help the
14
14
project.
15
15
16
-
#### Quick guide for documentation
17
-
You can directly edit documents at https://github.com/typelevel/spire/tree/main/docs/src/main/mdoc, but it is better to use git to manage diffs.
18
-
19
-
20
-
1. Visit https://github.com/typelevel/spire and fork the repository.
21
-
22
-
2. Clone the forked repository and make new branch.
23
-
24
-
3. Run `sbt docs/makeMicrosite` to build document website, change directory to `docs/target/site` and run `jekyll serve -b /spire`.
25
-
26
-
You can preview website at http://localhost:4000/spire by default.
27
-
28
-
Note: `makeMicrosite` depends on jekyll 4.x. Make sure that you have [jekyll(4+)](https://jekyllrb.com/docs/installation/) in your environment.
29
-
30
-
Finally, commit your changes and create PR at typelevel/spire repository.
16
+
The documentation lives in the [`docs/src/main/mdoc`](https://github.com/typelevel/spire/tree/main/docs/src/main/mdoc) directory in the repository. To preview the website locally:
2. Run `sbt docs/makeMicrosite`. Change directory to `docs/target/site` and run `jekyll serve -b /spire`.
20
+
3. Preview website at http://localhost:4000/spire.
32
21
33
22
### Reporting bugs, issues, or unexpected behavior
34
23
@@ -53,7 +42,7 @@ other people's opinions.
53
42
54
43
### Creating or improving tests
55
44
56
-
Spire uses [ScalaTest](https://www.scalatest.org) and
45
+
Spire uses [munit](https://scalameta.org/munit/) and
57
46
[ScalaCheck](https://scalacheck.org/) to test our code. The tests
58
47
fulfill a number of important functions:
59
48
@@ -88,9 +77,11 @@ not to get merged to main as quickly. For this kind of work, you
88
77
should submit a pull request from your branch, but we will probably
89
78
leave the PR open for awhile while commenting on it.
90
79
91
-
You can always ask questions at [Typelevel Discord](https://discord.com/invite/XF3CXcMzqD) or [Spire gitter](https://gitter.im/typelevel/spire), email the list, or visit the `#spire-math` IRC channel
80
+
You can always message the `#spire` channel on the [Typelevel Discord](typelevel-discord)
Here is a list of libraries that are based on Spire, or have Spire compatibility.
5
5
6
6
-[Libra](https://to-ithaca.github.io/libra/), dimensional analysis for Scala
7
-
-[coulomb](https://github.com/erikerlandson/coulomb)colomb: unit analysis for Scala
8
-
-[circe-spire](https://github.com/circe/circe-spire) circe codecs for Spire types
7
+
-[coulomb](https://github.com/erikerlandson/coulomb)coulomb: unit analysis for Scala
8
+
-[circe-spire](https://github.com/circe/circe-spire) circe encoders and decoders for Spire types
9
9
-[onnx-scala](https://github.com/EmergentOrder/onnx-scala) An ONNX (Open Neural Network eXchange) API and backend for typeful, functional deep learning in Scala (3)
10
10
-[NDScala](https://github.com/SciScala/NDScala) N-dimensional arrays in Scala 3. Think NumPy ndarray, but with compile-time type-checking/inference over shapes, ndarray/axis labels & numeric data types
11
11
-[Sonic reducer](https://github.com/rklaehn/sonicreducer), Hierarchical reducer for arbitrary Scala sequences
12
12
-[spire-matrix](https://github.com/lJoublanc/spire-matrix), BLAS-backed implementation of `VectorSpace`. See #675. POC/Not for prod use.
@@ -154,8 +152,7 @@ There are too many gotchas with specialization to list here. But the
154
152
4. Specialization will increase bytecode size by a factor of x2-10.
155
153
156
154
If you have questions about specialization feel free to ask on the
157
-
mailing list or [gitter channel](https://gitter.im/typelevel/spire). You may notice that some code in Spire is structured in
158
-
an unusual way, and often this is to make sure specialization works
155
+
`#spire` channel on the [Typelevel Discord](https://discord.com/invite/XF3CXcMzqD). You may notice that some code in Spire is structured inan unusual way, and often this is to make sure specialization works
159
156
properly.
160
157
161
158
You may find that it's easy to develop generic code without using
@@ -189,13 +186,11 @@ properties themselves remain the same.
189
186
190
187
#### Eq
191
188
192
-
Spire provides an `Eq[A]` type class to represent type-safe
193
-
equality. This allows us to talk about types for which there isn't a
189
+
Spire uses an `Eq[A]` type class to represent type-safe
190
+
equality. This allows us to talk about types for which there isn't a
194
191
computationally useful notion of equality, and also to avoid
195
192
programming errors caused by universal equality.
196
193
197
-
It means that comparing two values of incomparable types with `===` operator raises **compile error**, while Scala's standard `==` operator usually raises error at runtime.
198
-
199
194
`Eq[A]` provides two operators
200
195
201
196
*`eqv` (`a === b`) equality operator.
@@ -208,7 +203,6 @@ Spire requires that `eqv` obey the laws of an equivalence relation, namely:
208
203
* if `a === b` then `a` is `b` (*anti-symmetry*)
209
204
* if `a === b` and `b === c` then `a === c` (*transitivity*)
210
205
211
-
212
206
The anti-symmetry property may seem confusing. The idea is that if `a === b`
213
207
then `a` and `b` must be substitutable for each other, such that for any
We spire (and typelevel) have [dicord](https://discord.com/invite/XF3CXcMzqD), [gitter chat](https://gitter.im/typelevel/spire) and [mailing list](https://groups.google.com/group/typelevel/).
43
-
44
-
-[typelevel dicord](https://discord.com/invite/XF3CXcMzqD): community for all typelevel-stack contributers and users.
45
-
-[spire gitter](https://gitter.im/typelevel/spire) : place to go for announcements and discussions around Spire.
46
-
-[mailng list](https://groups.google.com/group/typelevel/): place to go for announcements and discussions around [Typelevel projects](https://typelevel.org).
47
-
48
-
38
+
There is `#spire` channel on the [Typelevel Discord](https://discord.com/invite/XF3CXcMzqD).
39
+
It is the place to go for announcements and discussions around Spire.
49
40
50
41
We also have a guide on [contributing to Spire](./extra_md/contributing.html) as well
51
42
as a guide that provides information on [Spire's guide](./guide.html) and [design notes](./extra_md/design.html).
@@ -58,25 +49,20 @@ merging pull requests, and for helping to guide the direction of Spire:
Spire is currently available for Scala 2.11, 2.12 and 2.13, for the
63
+
Spire is currently available for Scala 2.13 and 3.1+, for the
73
64
JVM and JS platforms.
74
65
75
-
**Since v0.18.0, spire is available for Scala 3!**.
76
-
77
-
If you have already used spire of older version, check [migration guide](./extra_md/changes.html#version-0180-m1) because there are some breaking changes.
78
-
79
-
80
66
To get started with SBT, simply add the following to your `build.sbt` file:
@@ -108,12 +88,13 @@ and uses this project to interoperate with [Cats](https://github.com/typelevel/c
108
88
109
89
### Playing Around
110
90
111
-
If you are new to Scala, or does not have Scala (or sbt) locally, try spire at [scastie](https://scastie.scala-lang.org/LVRAHaJAS7qoVbUyoDgKNA) on browser.
91
+
The quickest way to try spire is in the browser with [Scastie](https://scastie.scala-lang.org/LVRAHaJAS7qoVbUyoDgKNA).
You can also play around with IntelliJ or VS Code & Metals.
131
-
132
-
For example, create `spire.worksheet.sc` and copy-paste the following code snippet.
111
+
You can also play around with [IntelliJ](https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html) or [VS Code and Metals](https://scalameta.org/metals/docs/editors/vscode/).
133
112
134
-
Then, open `spire.worksheet.sc` with IntelliJ or CS Code (needs [metals VS Code extension](https://scalameta.org/metals/docs/editors/vscode/)).
113
+
Create a [worksheet](https://scalameta.org/metals/docs/editors/vscode/#worksheets) file `spire.worksheet.sc` in your IDE and copy-paste the following code snippet.
0 commit comments