Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
natefaubion
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
natefaubion
7y ago
It's something that comes from Haskell. The `where` keyword always starts a new layout/indentation context. It's not strictly necessary and there are ways around it, so it's just a point of consistency.
2.
▲
by
natefaubion
7y ago
Yes, I'm not saying there aren't usages for them in general, but PureScript currently occupies a niche that doesn't get down to the level of binary file formats. This change is more about "only supporting what we need to
3.
▲
by
natefaubion
7y ago
We found no usages of it in the wild. If there is real-world need for them, we'll consider adding them back.
4.
▲
Sparkler -- Native pattern matching for JavaScript using sweet.js macros
(github.com)
2 points
by
natefaubion
13y ago
|
0 comments
5.
▲
by
natefaubion
13y ago
There aren't native modules in JS (though they are coming in ES6). The module pattern is a way of having private scope by wrapping everything in a closure. So yes, the module pattern just creates a closure and returns an object (or assigns
6.
▲
by
natefaubion
13y ago
A cleaner way of doing the immediately-invoking function in CS is to use a `do` statement. MyModule = do -> # module body No need for any parens.
7.
▲
ReactiveCocoa -- an Objective-C framework for Functional Reactive Programming.
(github.com)
2 points
by
natefaubion
13y ago
|
0 comments
8.
▲
by
natefaubion
13y ago
If you're interested in doing some of this stuff in JS, there's sweet.js[1] for macros. I've also implemented some similar stuff as libraries: adt.js[2], matches.js[3], and tailrec.js[4]. By implementing them as libraries, I've given up som
9.
▲
by
natefaubion
13y ago
With pattern matching, the term on the left is a destructuring of the term on the right. Using a static instance like that isn't what you normally do in practice, but rather something like: myfoo = Foo(4, Bar(3, 8)) with patterns:
10.
▲
Tailrec.js -- Dead simple auto-trampolining for Javascript
(github.com)
5 points
by
natefaubion
14y ago
|
3 comments
11.
▲
by
natefaubion
14y ago
I find it helps when you use short-circuiting. The returns are the first thing you see, making it more obvious what is going on. myfn = (arg) -> return 1 if arg is "one" return 2 if arg is "two" return arg.toInt() Thi
12.
▲
by
natefaubion
14y ago
That's along similar lines, but more like guards in Haskell: http://en.wikibooks.org/wiki/Haskell/Control_structures
13.
▲
by
natefaubion
14y ago
It meshes pretty well as is. If only I could get rid of the strings and redundant arguments. mymap = pattern { '_, []' : -> [] 'f, [x, xs...]' : (f, x, xs) -> [f x].concat mymap(f, xs) } It shares a lot of th
14.
▲
by
natefaubion
14y ago
You are correct. There is not a guarantee for the future, though I doubt this behavior will change for V8 (this is currently node only). If that scares you, you can use the combinator syntax (check out the readme towards the bottom). The ob
15.
▲
by
natefaubion
14y ago
Take a look at the next sentence: "Keep in mind, that time is measured in the single microseconds (1µs vs 3µs) to dispatch 5 calls to the same function." So you are still looking at sub-microsecond dispatch time for a single call. If you lo
16.
▲
by
natefaubion
14y ago
Pattern matching is common in functional languages like Haskell or Scala. It's like a form of overloading on steroids, letting you inspect the values and structure of the arguments passed to your function (with a very terse syntax), and do
17.
▲
Show HN: Matches.js -- Powerful Pattern Matching for Javascript
(github.com)
96 points
by
natefaubion
14y ago
|
20 comments
18.
▲
Child view event delegation for Backbone
(github.com)
1 points
by
natefaubion
14y ago
|
0 comments
19.
▲
by
natefaubion
15y ago
I don't think so. It's not like it really does things for you or abstracts away the weirdness of CSS like jQuery does for JS. You can't write a functioning website without knowing all the quirks of CSS rendering. The only thing it's done fo
20.
▲
by
natefaubion
15y ago
Might I also suggest nib, and excellent set of Stylus extensions for working with CSS3. One of the most useful features is image inlining, especially for gradients. While they end up being a fixed size, they also work crossbrowser (at least