This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let y = f => (x => f(x(x)))(x => f(x(x))); | |
let z = f => (x => f(n => x(x)(n)))(x => f(n => x(x)(n))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function array(lt) { | |
let yes = f => y => f(); | |
let no = x => f => f(); | |
let when = c => c; | |
let undef = (_ => _)(); | |
let is_undef = n => n === undef ? yes : no; | |
let pair = l => r => f => f(l)(r); | |
let left = p => p(l => _ => l); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let yes = f => y => f(); | |
let no = x => f => f(); | |
let not = b => b(() => no)(() => yes); | |
let when = c => c; | |
let undef = (_ => _)(); | |
// 系統邊界 ... 在這邊就是借助 JavaScript 執行環境,這讓事情簡單一些 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 完全不使用 undefined | |
let y = f => (x => f(n => x(x)(n)))(x => f(n => x(x)(n))); | |
let yes = f => y => f; | |
let no = x => f => f; | |
let when = c => c; | |
let not = b => b(no)(yes); | |
let undef = _ => no; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let lt = (f => (x => f(n => x(x)(n)))(x => f(n => x(x)(n))))(m => l => f => (_ => _)((l => l(_ => _ => (_ => f => f(_ => _))))(l))(_ => (_ => (f => _ => f(_ => _))))(_ => (h => t => (l => r => f => f(l)(r))(h)(t))(f((p => p(l => _ => l))(l)))(m((p => p(_ => r => r))(l))(f))))((e => (l => (f => (x => f(n => x(x)(n)))(x => f(n => x(x)(n))))(v => r => l => (_ => _)((l => l(_ => _ => (_ => f => f(_ => _))))(l))(_ => r)(_ => v((h => t => (l => r => f => f(l)(r))(h)(t))((p => p(l => _ => l))(l))(r))((p => p(_ => r => r))(l))))(_ => (f => _ => f(_ => _)))(l))(e(_ => _ => (f => _ => f(_ => _)))))((f => (x => f(n => x(x)(n)))(x => f(n => x(x)(n))))(r => t => h => (_ => _)((n => n(_ => (_ => f => f(_ => _)))(_ => f => f(_ => _)))(h))(_ => t)(_ => r((h => t => (l => r => f => f(l)(r))(h)(t))(h)(t))))(_ => (f => _ => f(_ => _)))(f => x => f(x))(f => x => f(f(x)))(f => x => f(f(f(x))))))(e => (m => n => n(n => (p => p(l => _ => l))(n(p => (l => r => f => f(l)(r))((p => p(_ => r => r))(p))((n => f => x => f(n(f)(x)))((p = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(array( | |
(y => | |
(unit => | |
(no_use => | |
(yes => | |
(no => | |
(when => | |
(not => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class List { | |
constructor(array) { | |
this.array = array; | |
} | |
get first() { | |
return this.array[0]; | |
} | |
get tail() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class List { | |
constructor(array) { | |
this.array = array; | |
} | |
get first() { | |
return this.array[0]; | |
} | |
get tail() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function println(v) { | |
console.log(v.toString()); | |
} | |
class List { | |
constructor(array) { | |
this.array = array; | |
} | |
get first() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// === Tokenizer | |
class Tokens { | |
constructor(tokens) { | |
this.head = tokens[0]; | |
this.tail = tokens.slice(1); | |
} | |
} | |
class Tokenizer { |