@@ -40,19 +40,17 @@ interoperability with the rest of the Scala ecosystem.
40
40
41
41
## Typelevel Scala releases
42
42
43
- Currently Typelevel Scala is available as a drop in replacement for Lightbend Scala 2.11.8 and 2.12.1. As soon
44
- as Lightbend Scala 2.11.9 is published a corresponding release of Typelevel Scala will be published.
43
+ Typelevel Scala releases are distinguished from the corresponding Lightbend Scala releases by a version number suffix
44
+ which indicates the Typelevel feature level beyond the baseline compiler. We are attempting to maintain parity of
45
+ Typelevel features across the Scala compiler versions we support.
45
46
46
- Full release notes are available,
47
+ The current Typelevel feature level is 4 and it is avaliable as a drop in replacement for Lightbend Scala 2.11.11 and
48
+ 2.12.2. Full release notes are available,
47
49
48
- + Typelevel Scala [ 2.11.8] ( https://github.com/typelevel/scala/blob/typelevel-readme/notes/2.11.8.md ) .
49
- + Typelevel Scala [ 2.12.1] ( https://github.com/typelevel/scala/blob/typelevel-readme/notes/2.12.1.md ) .
50
+ + Typelevel Scala 4 [ 2.12.2/2.11.11] ( https://github.com/typelevel/scala/blob/typelevel-readme/notes/typelevel-4.md ) .
50
51
51
- ## Older releases
52
-
53
- Full release notes are available,
54
-
55
- + Typelevel Scala [ 2.12.0] ( https://github.com/typelevel/scala/blob/typelevel-readme/notes/2.12.0.md ) .
52
+ Support for Scala 2.13.0-M1 will be added in due course. Support for Scala 2.10.6 will be considered if sponsors step
53
+ forward to support the necessary work.
56
54
57
55
## Should I use Typelevel Scala? In production?
58
56
@@ -80,89 +78,122 @@ relevant to practitioners.
80
78
81
79
## Try Typelevel Scala with an Ammonite instant REPL
82
80
83
- The quickest way to get to a Typelevel Scala 2.11.8 REPL path is to run the provided
81
+ The quickest way to get to a Typelevel Scala 2.12.2 REPL path is to run the provided
84
82
[ "try Typelevel Scala"] [ try-tls ] script, which has no dependencies other than an installed JDK. This script
85
83
downloads and installs [ coursier] [ coursier ] and uses it to fetch the [ Ammonite] [ ammonite ] REPL and Typelevel Scala
86
- 2.11.8 . It then drops you immediately into a REPL session,
84
+ 2.12.2 . It then drops you immediately into a REPL session,
87
85
88
86
``` text
89
87
% curl -s https://raw.githubusercontent.com/typelevel/scala/typelevel-readme/try-typelevel-scala.sh | bash
90
88
Loading...
89
+ Compiling replBridge.sc
90
+ Compiling interpBridge.sc
91
+ Compiling HardcodedPredef.sc
92
+ Compiling ArgsPredef.sc
91
93
Compiling predef.sc
92
94
Compiling SharedPredef.sc
93
95
Compiling LoadedPredef.sc
94
- Welcome to the Ammonite Repl 0.7.8
95
- (Scala 2.11.8 Java 1.8.0_112)
96
+ Welcome to the Ammonite Repl 0.8.4
97
+ (Scala 2.12.2-bin-typelevel-4 Java 1.8.0_131)
98
+ If you like Ammonite, please support our development at www.patreon.com/lihaoyi
99
+ @
96
100
@ repl.compiler.settings.YliteralTypes.value = true
97
101
98
102
@ trait Cond[T] { type V ; val value: V }
99
103
defined trait Cond
100
104
@
101
105
@ implicit val condTrue = new Cond[true] { type V = String ; val value = "foo" }
102
- condTrue: AnyRef with Cond[true]{type V = String} = $sess.cmd2$$anon$1@22265a2d
106
+ condTrue: AnyRef with Cond[true]{type V = String} = $sess.cmd2$$anon$1@4fef2259
103
107
@ implicit val condFalse = new Cond[false] { type V = Int ; val value = 23 }
104
- condFalse: AnyRef with Cond[false]{type V = Int} = $sess.cmd3$$anon$1@606ab048
108
+ condFalse: AnyRef with Cond[false]{type V = Int} = $sess.cmd3$$anon$1@463887f6
105
109
@
106
110
@ def cond[T](implicit cond: Cond[T]): cond.V = cond.value
107
111
defined function cond
108
112
@
109
113
@ cond[true] : String
110
- res8 : String = "foo"
114
+ res5 : String = "foo"
111
115
@ cond[false] : Int
112
- res7 : Int = 23
116
+ res6 : Int = 23
113
117
@ Bye!
114
118
%
115
119
```
116
120
117
121
[ try-tls ] : https://github.com/typelevel/scala/blob/typelevel-readme/try-typelevel-scala.sh
118
- [ coursier ] : https://github.com/alexarchambault /coursier
122
+ [ coursier ] : https://github.com/coursier /coursier
119
123
[ ammonite ] : https://github.com/lihaoyi/Ammonite
120
124
121
- ## How to use Typelevel Scala 2.12.1 with SBT
125
+ ## How to use Typelevel Scala 4 with SBT
122
126
123
- There are two requirements for using Typelevel Scala in your existing projects,
127
+ Requirements for using Typelevel Scala in your existing projects,
124
128
125
- + You must be using (or be able to switch to) Lightbend Scala 2.12.1 .
126
- + You must be using (or be able to switch to) SBT 0.13.13 or later. Earlier versions of SBT don't have full support
127
- for using an alternative ` scalaOrganization ` .
129
+ + You must be using Lightbend Scala 2.12.2 or 2.11.11 .
130
+ + You must be using SBT 0.13.13 or later.
131
+ + Your build should use ` scalaOrganization.value ` and ` CrossVersion.patch ` appropriately .
128
132
129
- If these conditions are met the following steps will build your project with Typelevel Scala,
133
+ You can find many examples linked to from [ this issue] [ build-tweaks-1 ] .
134
+ + (Optional) Your build should scope ` scalaVersion ` to ` ThisBuild ` .
130
135
131
- + Ensure that your ` project/build.properties ` specifies SBT 0.13.13 ,
136
+ You can find an example in [ this shapeless commit ] [ build-tweaks-2 ] ,
132
137
133
138
```
134
- sbt.version=0.13.13
139
+ inThisBuild(Seq(
140
+ organization := "com.chuusai",
141
+ scalaVersion := "2.12.2",
142
+ crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.2", "2.13.0-M1")
143
+ ))
135
144
```
136
145
137
- + Add the following to your ` build.sbt ` immediately next to where you set ` scalaVersion ` ,
146
+ You can now temporarily build with Typelevel Scala by entering ,
138
147
139
- ```
140
- scalaOrganization in ThisBuild := "org.typelevel"
141
- ```
148
+ ```
149
+ > ; set every scalaOrganization := "org.typelevel" ; ++2.12.2-bin-typelevel-4
150
+ ```
142
151
143
- Alternatively, if you want to try Typelevel Scala without modifying your ` build.sbt ` you can instead create a file
144
- ` local.sbt ` at the root of your project with the following content,
152
+ on the SBT REPL. You can verify that the settings have been updated correctly using ` show ` ,
145
153
146
- ```
147
- scalaOrganization in ThisBuild := "org.typelevel"
148
- ```
154
+ ```
155
+ > show scalaOrganization
156
+ [info] org.typelevel
157
+ > show scalaVersion
158
+ [info] 2.12.2-bin-typelevel-4
159
+ ```
160
+
161
+ To switch your project permanently to Typelevel Scala 4 update your ` build.sbt ` as follows,
162
+
163
+ ```
164
+ inThisBuild(Seq(
165
+ scalaOrganization := "org.typelevel"
166
+ scalaVersion := "2.12.2-bin-typelevel-4"
167
+ ))
168
+ ```
169
+
170
+ Alternatively, if you want to try Typelevel Scala without modifying your ` build.sbt ` and you have scoped
171
+ ` scalaVersion ` as shown earlier you can instead create a file ` local.sbt ` at the root of your project with the
172
+ following content,
173
+
174
+ ```
175
+ inThisBuild(Seq(
176
+ scalaOrganization := "org.typelevel",
177
+ scalaVersion := "2.11.11-bin-typelevel-4"
178
+ ))
179
+ ```
149
180
150
- This will be merged with your main build definitions and can be added to ` .gitignore ` or ` .git/info/exclude ` if so
151
- desired.
181
+ These settings will override the ` ThisBuild ` scoped settings in your ` build.sbt ` .
152
182
153
- Now your build should function as before but using the Typelevel Scala toolchain instead of the Lightbend one. You can
154
- verify this from the SBT prompt,
183
+ Whichever method you choose, your build should now function as before but using the Typelevel Scala toolchain instead
184
+ of the Lightbend one. You can verify that the settings have been updated correctly from the SBT prompt using ` show ` ,
155
185
156
186
```
157
187
> show scalaOrganization
158
188
[info] org.typelevel
159
- >
189
+ > show scalaVersion
190
+ [info] 2.12.2-bin-typelevel-4
160
191
```
161
192
162
- Gote that Typelevel Scala 2.11.8 replaces the [ si2712fix compiler plugin ] [ si2712fix-plugin ] & mdash ; if you are using
163
- it you should remove it from your build before switching to Typelevel Scala.
193
+ [ build-tweaks-1 ] : https://github.com/typelevel/scala/issues/135
194
+ [ build-tweaks-2 ] : https://github.com/milessabin/shapeless/blob/master/build.sbt#L13-L17
164
195
165
- ## How to use Typelevel Scala 2.12.1 with Maven
196
+ ## How to use Typelevel Scala 4 with Maven
166
197
167
198
If you are using maven with the ` scala-maven-plugin ` , set the ` <scalaOrganization> ` to ` org.typelevel ` ,
168
199
@@ -173,13 +204,14 @@ If you are using maven with the `scala-maven-plugin`, set the `<scalaOrganizatio
173
204
<version>3.2.1</version>
174
205
<configuration>
175
206
<scalaOrganization>org.typelevel</scalaOrganization>
207
+ <scalaVersion>2.12.2-bin-typelevel-4</scalaOrganization>
176
208
</configuration>
177
209
</plugin>
178
210
```
179
211
180
212
## Roadmap
181
213
182
- The following are high priority issues for Typelevel projects on which progress is likely to be made in 2016 ,
214
+ The following are high priority issues for Typelevel projects on which progress is likely to be made in 2017 ,
183
215
184
216
+ Partial type application
185
217
+ Multiple implicit parameter blocks
@@ -241,22 +273,13 @@ The current maintainers (people who can merge pull requests) are:
241
273
[ fork ] : http://typelevel.org/blog/2014/09/02/typelevel-scala.html
242
274
[ lbs ] : https://github.com/scala/scala
243
275
[ projects ] : http://typelevel.org/projects/
244
- [ SI-2712 ] : https://issues.scala-lang.org/browse/SI-2712
245
- [ pr-2712 ] : https://github.com/scala/scala/pull/5102
246
- [ SI-7046 ] : https://issues.scala-lang.org/browse/SI-7046
247
- [ pr-7046 ] : https://github.com/scala/scala/pull/5284
248
- [ SI-9760 ] : https://issues.scala-lang.org/browse/SI-9760
249
- [ SIP-23 ] : https://github.com/scala/scala/pull/5310
250
- [ si2712fix-plugin ] : https://github.com/milessabin/si2712fix-plugin
251
276
[ tls-gitter ] : https://gitter.im/typelevel/scala
252
277
[ lbs-gitter ] : https://gitter.im/scala/contributors
253
278
[ typelevel ] : http://typelevel.org/
254
279
[ coc ] : http://typelevel.org/conduct.html
255
280
[ lbs-readme ] : https://github.com/scala/scala/blob/2.12.x/README.md
256
281
[ scalac-post ] : http://milessabin.com/blog/2016/05/13/scalac-hacking/
257
282
[ milessabin ] : https://github.com/milessabin
258
- [ 2.11.8-bin-typelevel ] : https://github.com/typelevel/scala/commits/2.11.8-bin-typelevel
259
- [ 2.12.0-bin-typelevel ] : https://github.com/typelevel/scala/commits/2.12.0-bin-typelevel
260
283
[ scala-cla ] : http://www.lightbend.com/contribute/cla/scala
261
284
[ scala-license ] : https://github.com/scala/scala/blob/2.12.x/doc/LICENSE.md
262
285
[ apache-2.0-license ] : http://www.apache.org/licenses/LICENSE-2.0
0 commit comments