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
U = -> it it | |
U U | |
/* | |
$ lsc infinite-loop.ls | |
Failed at: infinite-loop.ls | |
RangeError: Maximum call stack size exceeded | |
*/ |
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
global <<< require \prelude-ls | |
[1 til 1000] |> (filter -> it % 3 == 0 || it % 5 == 0) |> sum |> console.log | |
/* | |
$ lsc project-eular-001.ls | |
233168 | |
*/ |
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
global <<< require \prelude-ls | |
gen-list-while = (f, max) -> | |
list = [] | |
i = 0 | |
while f(i) < max then f(i++) |> list.push | |
list | |
memoize = (memo, f) -> shell = (n) -> memo[n] ?= f shell, 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
app = express! | |
server = http.createServer app | |
io = require \socket.io .listen do | |
server | |
origins: 'hoge.jp:*' |
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
a = name: 'alice' | |
console.log a.name | |
b = ^^a | |
console.log b.name | |
b.name = 'bob' | |
console.log b.name | |
console.log a.name |
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
usersA = [ id: 4872, name: 'alice' ] | |
usersB = [ id: 2849, name: 'bob' ] | |
users = (usersA ++ usersB) |> sort-by (.id) | |
console.log users |
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
Y = (r) -> ((f) -> f f)((f) -> r (x) -> f f x) |
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
Num.ls |
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
List.ls |
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
Str.ls |
OlderNewer