namespace storage fix, namespace enter fix, maybe other fixes

This commit is contained in:
ProgramSnail 2023-05-13 18:53:54 +03:00
parent 4882d458f8
commit 4b4756b657
11 changed files with 250 additions and 174 deletions

View file

@ -1,17 +1,17 @@
basic Float
basic Int
basic String
basic Char
basic Bool
basic Unit
// basic Float
// basic Int
// basic String
// basic Char
// basic Bool
// basic Unit
//
decl not : Bool -> Bool
def not : x =
match x with
| true -> false
| false -> true
(match x with
| true -> false
| false -> true)
decl ( && ) : Bool -> Bool -> Bool
def ( && ) : x y =
@ -40,7 +40,7 @@ typeclass Eq =
& var ( != ) : Eq -> Bool
namespace const Eq {
def var ( != ) : x = not: (self == x)
def ( != ) : x = not: (self == x)
}
//
@ -101,13 +101,11 @@ typeclass Bounded =
typeclass Enum =
& var succ : -> (Optional Enum)
& var pred : -> (Optional Enum)
& toEnum : Int -> Enum
& var fromEnum : -> Int
& to_enum : Int -> Enum
& var from_enum : -> Int
//
// // bad
// typeclass Functor 'A =
// & fmap 'B ('F : (#Functor 'B)) : ('A -> 'B) -> Functor -> 'F
@ -120,11 +118,6 @@ typeclass Enum =
// & begin : -> 'Iter
// & end : -> 'Iter
//
class Slice ('Elem : ) ('Structure : (#Iterable)) =
//
decl ( -- ) : Int -> Int -> Int_0