-
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.
Merge pull request #239 from VirtusLab/fix-nightly
Uncurry typelambdas to fix the recent implicit generation change
- Loading branch information
Showing
15 changed files
with
47,593 additions
and
20 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.
Oops, something went wrong.