scala, categories, good news
Feb. 14th, 2009 01:48 pmAt last started seriously working on the code. Love Scala.
(the following is a trivial validation code for a poset)
(the following is a trivial validation code for a poset)
def validate() {
foreach((x: T) => {
require(le(x, x), " reflexivity broken at " + x)
foreach((y: T) => {
if (le(x, y)) {
if (le(y, x)) require(x.equals(y), " antisymmetry broken at " + x + ", " + y)
foreach((z: T) =>
if (le(y, z)) require(le(x, z), "transitivity broken at " + x + ", " + y + ", " + z)
)
}
})
})
}