All Downloads are FREE. Search and download functionalities are using the official Maven repository.

la-extensions_2.10.0.4.1.source-code.constraint.scala Maven / Gradle / Ivy

There is a newer version: 0.5.1
Show newest version
package org.cvogt.scala.constraint
import scala.annotation.implicitNotFound

import boolean._

/**
type-level constraints for subtyping and type identity checks.
*/
object `package`{
  @implicitNotFound(msg = "Cannot prove ${Left} =:= ${Right}")
  type =:=[Left,Right] = scala.Predef.=:=[Left,Right]
  @implicitNotFound(msg = "Cannot prove ${Left} <:< ${Right}")
  type <:<[Left,Right] = scala.Predef.<:<[Left,Right]

  @implicitNotFound(msg = """Cannot prove ${Left} !<:< ${Right}""")
  type !<:<[Left,Right] = ![<:<[Left,Right]]
  @implicitNotFound(msg = """Cannot prove ${Left} !=:= ${Right}""")
  type !=:=[Left,Right] = ![=:=[Left,Right]]


  @implicitNotFound(msg = """Cannot prove ${Left} >:> ${Right}""")
  type  >:>[Right,Left] =  <:<[Left,Right]
  @implicitNotFound(msg = """Cannot prove ${Left} !>:> ${Right}""")
  type !>:>[Right,Left] = !<:<[Left,Right]
}
/*
/** Proves that Left is NOT a subtype of ${Right} */
@implicitNotFound(msg = "Cannot prove ${Left} !<:< ${Right}")
final class !<:<[Left, ${Right}]
object !<:<{
  implicit def prove[Left,Right](implicit ev: ![Left <:< ${Right}]) = new !<:<[Left,Right]
}

/** Proves that Left is NOT identical to ${Right} */
@implicitNotFound(msg = "Cannot prove ${Left} !=:= ${Right}")
final class !=:=[Left, ${Right}]
object !=:={
  implicit def prove[Left,Right](implicit ev: ![Left =:= ${Right}]) = new !=:=[Left,Right]
}
*/




© 2015 - 2025 Weber Informatics LLC | Privacy Policy