mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 06:58:45 +00:00
namespace storage fix, namespace enter fix, maybe other fixes
This commit is contained in:
parent
4882d458f8
commit
4b4756b657
11 changed files with 250 additions and 174 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue