Quite a few more bang files for testing.

This commit is contained in:
2011-02-03 20:26:09 -05:00
parent bc435d83f8
commit 17ca2f7899
6 changed files with 396 additions and 20 deletions

27
bsrc/Data/Object.bs Normal file
View File

@@ -0,0 +1,27 @@
module Data.Object
import Data.Bool;
export eq(x :: a, y :: a) :: Bool = prim%eq(x,y);
class Eq a {
(==)(x :: a, y :: a) :: Bool = not (x /= y);
(/=)(x :: a, y :: a) :: Bool = not (x == y);
}
instance Eq () {
(==)(x,y) = True;
(/=)(x,y) = False;
}
instance Eq Bool {
(/=)(x,y) = x ^ y;
}
class SafelyConvertable a b {
safeConvert :: a -> b;
}
class UnsafelyConvertable a b {
unsafeConvert :: a -> b;
}