Functional Programming in JavaScript using LiveScript and prelude.ls
gkz.github.com
gkz.github.com
Check out the "10 LiveScript one-liners to impress your friends" post. Great stuff: http://gkz.github.com/LiveScript/blog/livescript-one-liners-...
map (-> it.length > x), list
map (call \toUpperCase), 'haha'
for functions with only one free variable?IMHO it would be prettier to have something like scala's _
map (_.length > x), list
map (_.toUpperCase), 'haha'
i.e. automatically build a closure when _ is used eithout the need for additional anonymous function syntaxhttps://github.com/gkz/LiveScript/issues/19 https://github.com/taku0/placeholder_syntax_for_coffeescript...
map (.length) x
rather than map (call \length) x
does not fit more complex usage, but it's a tiny improvement I'd think _.method(param)
to be a function, but for a.method(param)
to not be a function (unless of course method returns a function)It also doesn't nest properly
it
will
get
tedious
when
you
are
nesting
multiple
blocks
of
code.
And I like it when Xcode highlights the brackets/parenthesis because it's just easier to pick up ( and ) and { and } from a line of text. If {
Your {
Code {
Is {
That {
Nested {
}
}
}
}
}
}
Then you at not using the functional programming constructs available to you and have poorly decomposed code. Deep nesting is a major code smell.brian@brianmckenna.org
(also, I'm writing an untyped typeclassopedia for use in my compiler - I'll be releasing it soon - definitely feel that'd be a complement to prelude.ls)
I was looking forward to see your presentation in SpainJS next month, but I might not be able to make it.
Is there any of your roy talks online or any gentle introduction to roy besides roy.brianmckenna.org?
I wrote an article about it for IEEE's Internet Computing magazine: http://brianmckenna.org/blog/roy_ieee
I've also started writing an introduction but it has been shelved while I work on making the typesystem sound.
Hopefully I'll see you at SpainJS if you make it :)