-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uncurry typelambdas to fix the recent implicit generation change
- Loading branch information
1 parent
dbf2606
commit 7e3d042
Showing
13 changed files
with
47,581 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
engine/src/main/scala/org/virtuslab/inkuire/engine/impl/model/Signature.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
engine/src/main/scala/org/virtuslab/inkuire/engine/impl/service/TypeNormalizationOps.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.virtuslab.inkuire.engine.impl.service | ||
|
||
import org.virtuslab.inkuire.engine.impl.model._ | ||
import com.softwaremill.quicklens._ | ||
|
||
trait TypeNormalizationOps { | ||
def uncurryTypes(tpe: TypeLike): TypeLike = tpe match { | ||
case TypeLambda(args, t: Type) if args.zip(t.params).forall { case (a, p) => a == p.typ } => | ||
uncurryTypes(t.modify(_.params).setTo(List.empty)) | ||
case t: Type => | ||
t.modify(_.params.each.typ).using(uncurryTypes) | ||
case t: OrType => | ||
t.modifyAll(_.left, _.right).using(uncurryTypes) | ||
case t: AndType => | ||
t.modifyAll(_.left, _.right).using(uncurryTypes) | ||
case t: TypeLambda => | ||
t.modify(_.result).using(uncurryTypes) | ||
} | ||
|
||
def uncurrySignature(sgn: Signature): Signature = | ||
sgn.modifyAllTypes(uncurryTypes) | ||
} |
File renamed without changes.
47,527 changes: 47,527 additions & 0 deletions
47,527
engine/src/test/resources/stdlib-3.6.0-RC1.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters