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
//isValid = predicate/constraint | |
abstract class Type[T](val isValid : (T) => boolean) | |
{ | |
//X is the reference type | |
final protected[Type] case class X[T] (val value : T) { | |
override def toString = Type.this.getClass.getSimpleName + "(" + value + ")" | |
} | |
//Type is the alias for X[T] that we expose to the outside world | |
type Type = X[T] |