Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 379973f

Browse files
committed
Updates for TLS 4.
1 parent b4ed4fd commit 379973f

File tree

3 files changed

+512
-59
lines changed

3 files changed

+512
-59
lines changed

README.md

+77-54
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,17 @@ interoperability with the rest of the Scala ecosystem.
4040

4141
## Typelevel Scala releases
4242

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.
4546

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,
4749

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).
5051

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.
5654

5755
## Should I use Typelevel Scala? In production?
5856

@@ -80,89 +78,122 @@ relevant to practitioners.
8078

8179
## Try Typelevel Scala with an Ammonite instant REPL
8280

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
8482
["try Typelevel Scala"][try-tls] script, which has no dependencies other than an installed JDK. This script
8583
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,
8785

8886
```text
8987
% curl -s https://raw.githubusercontent.com/typelevel/scala/typelevel-readme/try-typelevel-scala.sh | bash
9088
Loading...
89+
Compiling replBridge.sc
90+
Compiling interpBridge.sc
91+
Compiling HardcodedPredef.sc
92+
Compiling ArgsPredef.sc
9193
Compiling predef.sc
9294
Compiling SharedPredef.sc
9395
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+
@
96100
@ repl.compiler.settings.YliteralTypes.value = true
97101
98102
@ trait Cond[T] { type V ; val value: V }
99103
defined trait Cond
100104
@
101105
@ 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
103107
@ 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
105109
@
106110
@ def cond[T](implicit cond: Cond[T]): cond.V = cond.value
107111
defined function cond
108112
@
109113
@ cond[true] : String
110-
res8: String = "foo"
114+
res5: String = "foo"
111115
@ cond[false] : Int
112-
res7: Int = 23
116+
res6: Int = 23
113117
@ Bye!
114118
%
115119
```
116120

117121
[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
119123
[ammonite]: https://github.com/lihaoyi/Ammonite
120124

121-
## How to use Typelevel Scala 2.12.1 with SBT
125+
## How to use Typelevel Scala 4 with SBT
122126

123-
There are two requirements for using Typelevel Scala in your existing projects,
127+
Requirements for using Typelevel Scala in your existing projects,
124128

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.
128132

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`.
130135

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],
132137

133138
```
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+
))
135144
```
136145

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,
138147

139-
```
140-
scalaOrganization in ThisBuild := "org.typelevel"
141-
```
148+
```
149+
> ; set every scalaOrganization := "org.typelevel" ; ++2.12.2-bin-typelevel-4
150+
```
142151

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`,
145153

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+
```
149180

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`.
152182

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`,
155185

156186
```
157187
> show scalaOrganization
158188
[info] org.typelevel
159-
>
189+
> show scalaVersion
190+
[info] 2.12.2-bin-typelevel-4
160191
```
161192

162-
Gote that Typelevel Scala 2.11.8 replaces the [si2712fix compiler plugin][si2712fix-plugin] — 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
164195

165-
## How to use Typelevel Scala 2.12.1 with Maven
196+
## How to use Typelevel Scala 4 with Maven
166197

167198
If you are using maven with the `scala-maven-plugin`, set the `<scalaOrganization>` to `org.typelevel`,
168199

@@ -173,13 +204,14 @@ If you are using maven with the `scala-maven-plugin`, set the `<scalaOrganizatio
173204
<version>3.2.1</version>
174205
<configuration>
175206
<scalaOrganization>org.typelevel</scalaOrganization>
207+
<scalaVersion>2.12.2-bin-typelevel-4</scalaOrganization>
176208
</configuration>
177209
</plugin>
178210
```
179211

180212
## Roadmap
181213

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,
183215

184216
+ Partial type application
185217
+ Multiple implicit parameter blocks
@@ -241,22 +273,13 @@ The current maintainers (people who can merge pull requests) are:
241273
[fork]: http://typelevel.org/blog/2014/09/02/typelevel-scala.html
242274
[lbs]: https://github.com/scala/scala
243275
[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
251276
[tls-gitter]: https://gitter.im/typelevel/scala
252277
[lbs-gitter]: https://gitter.im/scala/contributors
253278
[typelevel]: http://typelevel.org/
254279
[coc]: http://typelevel.org/conduct.html
255280
[lbs-readme]: https://github.com/scala/scala/blob/2.12.x/README.md
256281
[scalac-post]: http://milessabin.com/blog/2016/05/13/scalac-hacking/
257282
[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
260283
[scala-cla]: http://www.lightbend.com/contribute/cla/scala
261284
[scala-license]: https://github.com/scala/scala/blob/2.12.x/doc/LICENSE.md
262285
[apache-2.0-license]: http://www.apache.org/licenses/LICENSE-2.0

0 commit comments

Comments
 (0)