library


License

License

GroupId

GroupId

com.milessabin
ArtifactId

ArtifactId

si2712fix-library_2.10.6
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

library
library
Project URL

Project URL

https://github.com/milessabin/si2712fix-plugin
Project Organization

Project Organization

com.milessabin
Source Code Management

Source Code Management

https://github.com/milessabin/si2712fix-plugin

Download si2712fix-library_2.10.6

How to add to project

<!-- https://jarcasting.com/artifacts/com.milessabin/si2712fix-library_2.10.6/ -->
<dependency>
    <groupId>com.milessabin</groupId>
    <artifactId>si2712fix-library_2.10.6</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.milessabin/si2712fix-library_2.10.6/
implementation 'com.milessabin:si2712fix-library_2.10.6:1.2.0'
// https://jarcasting.com/artifacts/com.milessabin/si2712fix-library_2.10.6/
implementation ("com.milessabin:si2712fix-library_2.10.6:1.2.0")
'com.milessabin:si2712fix-library_2.10.6:jar:1.2.0'
<dependency org="com.milessabin" name="si2712fix-library_2.10.6" rev="1.2.0">
  <artifact name="si2712fix-library_2.10.6" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.milessabin', module='si2712fix-library_2.10.6', version='1.2.0')
)
libraryDependencies += "com.milessabin" % "si2712fix-library_2.10.6" % "1.2.0"
[com.milessabin/si2712fix-library_2.10.6 "1.2.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.6

provided (2)

Group / Artifact Type Version
org.scala-lang : scala-compiler jar 2.10.6
org.scala-lang : scala-reflect jar 2.10.6

Project Modules

There are no modules declared in this project.

SI-2712-fix plugin

This project fixes SI-2712 as a compiler plugin for Scala 2.10.x. This fix is in the compiler proper for Scala 2.11.x and Scala 2.12.x - see the Usage section for details.

The implementation is based on a simple algorithm as suggested by Paul Chiusano in the comments on SI-2712: Treat the type constructor as curried and partially applied, we treat a prefix as constants and solve for the suffix. For the example in the ticket, unifying M[A] with Int => Int, this unifies as,

M[t] = [t][Int => t]
A = Int

More detailed explanations can also be found at this gist Explaining Miles's Magic by @djspiewak and the readme of the demo project.

One place to discuss this fix is at typelevel's gitter room.

Usage

NOTE: This plugin should only be used by users still on Scala 2.10.x.

For Scala 2.11.x and 2.12.x users, the fix is available under the -Ypartial-unification compiler flag.

scalacOptions += "-Ypartial-unification"

Scala 2.12.x users can simply turn on the flag to enable the fix. Scala 2.11.x users can use Typelevel Scala with the same flag, or wait for Scala 2.11.9 which has the backport.

Scala 2.10.7 users can add the plugin by adding the following to their SBT build (no compiler flag needed):

addCompilerPlugin("com.milessabin" % "si2712fix-plugin_2.10.7" % "1.2.0")

// or
libraryDependencies += compilerPlugin("com.milessabin" % "si2712fix-plugin_2.10.7" % "1.2.0")

Examples

An example project can be found at milessabin/si2712fix-demo

Projects that use this plugin

Participation

This project supports the Typelevel code of conduct and wants all of its channels (Gitter, github, etc.) to be welcoming environments for everyone.

Building the plugin

This plugin is built with SBT 0.13.11 or later, and its master branch is built with Scala 2.11.8 and 2.10.7 by default.

Contributors

Versions

Version
1.2.0
1.1.0
1.0.1