mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 17:56:48 +03:00
Now, there are two local binders: let x = ... use x = ... The 'let' binder will create a local definition, type-check it, and assign a name to it. When compiled, it will create 'dup' nodes. The 'use' binder is just an alias. It will not bind a new variable, and, when compiled, will create inline copies. Also, for type-checking, it allows creating aliases that are definitionaly equal for the checker.
23 lines
891 B
Plaintext
23 lines
891 B
Plaintext
String.skip
|
|
: ∀(str: String) String
|
|
= λstr
|
|
use P = λx String
|
|
use cons = λc0 λcs
|
|
use P = λx ∀(c0: Char) ∀(cs: String) String
|
|
use true = λc0 λcs (String.skip cs)
|
|
use false = λc0 λcs
|
|
use P = λx ∀(c0: Char) ∀(cs: String) String
|
|
use true = λc0 λcs
|
|
use P = λx ∀(c0: Char) String
|
|
use cons = λc1 λcs λc0
|
|
use P = λx ∀(c0: Char) ∀(c1: Char) ∀(cs: String) String
|
|
use true = λc0 λc1 λcs (String.skip.comment cs)
|
|
use false = λc0 λc1 λcs (String.cons c0 (String.cons c1 cs))
|
|
(~(Char.is_slash c1) P true false c0 c1 cs)
|
|
use nil = λc0 (String.cons c0 String.nil)
|
|
(~cs P cons nil c0)
|
|
use false = λc0 λcs (String.cons c0 cs)
|
|
(~(Char.is_slash c0) P true false c0 cs)
|
|
(~(Char.is_blank c0) P true false c0 cs)
|
|
use nil = String.nil
|
|
(~str P cons nil) |