object FunType
Helper object with apply/unapply for matching and constructing LF function types.
The methods - automaticallycurry and uncurry. - and include the case n=0, in particular, unapply always matches!
"Normal" LF function type:
// Represent a1 -> ... -> an -> b FunType(List((None, a1),...,(None, an)), b)
Dependently typed LF function type:
// Pi x1:a1. ... Pi xn:an. b FunType(List((Some(x1), a1),...,(Some(xn), an)), b)
You can also mix both styles.
- Source
- LF.scala
Say you want to check whether a given term (of a type component) is a function type to
prop
:val typeComponent: Term = ... val propSymbol = GlobalName(...) // Give some specific MPath and LocalName match typeComponent { case FunType(args, OMS(propSymbol)) => ... case _ => ... }
, Say you already have a type and now want to add dependent types in front of it
// We have typeComponent and now want // {x: S} typeComponent val typeComponent: Term = ... val dependentVariableType: Term = ... val dependentTypes = List((Some(LocalName("x")), dependentVariableType)) val newTypeComponent = FunType(dependentTypes, typeComponent)
Examples:
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- FunType
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(in: List[(Option[LocalName], Term)], out: Term): Term
- def argsAsContext(args: List[(Option[LocalName], Term)]): Context
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def unapply(t: Term): Option[(List[(Option[LocalName], Term)], Term)]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()