We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Egison version 4.0.0 will have static type system.
The text was updated successfully, but these errors were encountered:
Egison has static type system from version 4.
Types are declarared as follow.
(define $map : (($A / $B) {A} / {B}) (lambda [$fn $xs] (match xs (list something) {[<nil> {}] [<cons $x $rs> {(fn x) @(map fn rs)}]})))
We can use type classes as follow. We don't support multi-parameter type classes.
(type $Ordering {<Less> <Equal> <Greater>}) (define $ordering : (Matcher Ordering) (algebraic-data-matcher {<less> <equal> <greater>})) (class $Ord $A :: Eq {[$lt? : (A A / Bool)]} {[$lte? : (A A / Bool) (lambda [$x $y] (or (lt? x y) (eq? x y)))] [$gte? : (A A / Bool) (lt? $2 $1)] [$gt? : (A A / Bool) (lte? $2 $1)] [$compare : (A A / Ordering) (lambda [$m $n] (if (lt? m n) <Less> (if (eq? m n) <Equal> <Greater>)))]}) (instance Integer Ord {[$lt? lt-integer?]})
Sorry, something went wrong.
No branches or pull requests
Egison version 4.0.0 will have static type system.
The text was updated successfully, but these errors were encountered: