Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tel
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
100 ms
·
961.
▲
by
tel
11y ago
Promises are monads. `ok` is `return :: a -> Promise a` and `then` is `bind :: Promise a -> (a -> Promise b) -> Promise b`. All other behavior arises from that, the monad laws, and the operations throw :: Error -> Promi
962.
▲
by
tel
11y ago
He's stating the problem is dynamic typing... so the expectation would be a type error (!).
963.
▲
by
tel
11y ago
I'm not sure how I feel about it honestly. I suppose in a dependently typed language there'd be some allowance for `IO Type`.
964.
▲
by
tel
11y ago
Re "Advanced Mistake #4", do Javascript programmers not know about tuples? Does nobody write functions with signatures like pair(pa: Promise<A>, pb: (a: A) => Promise<B>): Promise<{fst: A, snd: B}> {
965.
▲
by
tel
11y ago
Also having promise libraries which stuck closer to the basic monadic interface without lots of overloading would help things like Typescript and Flow catch all of the errors.
966.
▲
by
tel
11y ago
And this is why types are nice. Along with limited overloading.
967.
▲
by
tel
11y ago
Agreed, but there's a pretty straightforward distinction between statements amenable to becoming values and those that aren't. Essentially, those which control and define the type theory are out of scope as well as those which int
968.
▲
by
tel
11y ago
There are plenty of languages which evaluate fragments of your program as part of the checking step. Simple ones are not even that difficult to write. http://www.andres-loeh.de/LambdaPi/LambdaPi.pdf
969.
▲
by
tel
11y ago
This is a big part of what DT folks love, although only a part. Essentially the argue that we've already written one great language (supposedly), so why bolt a weak language atop it? Why not just use the same one twice? Of course, now
970.
▲
First Class Statements
(blog.jle.im)
48 points
by
tel
11y ago
|
13 comments
971.
▲
by
tel
11y ago
The weakness of type inference arises, as you note, due to subtype polymorphism. You can't escape from this when you've got class-based OO, it seems.
972.
▲
by
tel
11y ago
To clarify coolsunglasses's note that it is actually possible to hide side effects behind a pure interface (when they can be proven pure) here's the "counter" example in the paper import Control.Monad.ST impor
973.
▲
by
tel
11y ago
Who makes those arguments? Or rather, who makes them with such little sophistication? What's being described here is well-known and easily available in typed FP languages. It's a tiny application of the general properties of monad
974.
▲
by
tel
11y ago
Reading about this language gives me such a strange feeling. It makes me think of the cargo cults who worship airplane tributes due to once an airplane landing and providing supplies. Ela is clearly inspired by Haskell. It copies syntax and
975.
▲
by
tel
11y ago
The example is a bit misleading there. To be more clear using types there's xs :: [Maybe Int] head xs :: Maybe Int
976.
▲
by
tel
11y ago
The typing variation feels like it's going to so strongly change the pragmatic use of this language that the best I could say is that it is very distantly inspired by Haskell.
977.
▲
by
tel
11y ago
I liked Coq d'Art
978.
▲
by
tel
11y ago
The mechanics of that are easily captured with a monad, but baking it into the natural semantics of the language would be a neat experiment, I agree.
979.
▲
by
tel
11y ago
A majority of my concerns were resting on XML Schemas and the like—or even OWL (!)—but even recognizing what you mean about XML being semantically neutral it's still... semantically dangerous. The issue at hand where attributes and ele
980.
▲
by
tel
11y ago
I don't mind the syntax and suppose I agree that consensus syntax is the right syntax. The problem is beneath that: XML's semantics are tremendously large while also being a complete mess. The upshot is that the difficulty of be
981.
▲
by
tel
11y ago
Dependent type literature will answer both of your questions relatively quickly. Also look at "proof search" in that context.
982.
▲
by
tel
11y ago
I believe you can't have that happen universally since then you don't get the benefit of having exceptions bubble at all—you're just de facto operating in an error monad. On the other hand, if it's not universal then you
983.
▲
by
tel
11y ago
Hey, I'm glad! This is a really good find. I love Baez's writing so I'm pretty eager to run through this as well.
984.
▲
by
tel
11y ago
In my mind the trick is always in training models as it amounts to picking an optimal probability distribution from your manifold. Even in relatively simple mathematical statistics we quickly encounter curvature in exponential families but
985.
▲
by
tel
11y ago
In statistics you often think about having a "space of possible states of the world" and then seeking the point in that space which is in best concordance with the data you observe. [For instance, we might assume that a basketball
986.
▲
by
tel
11y ago
Closures are one implementation of functions. In a language which also has mutable variables, closures create a special kind of private variable behavior. You're used to thinking of functions which act on things passed into them via th
987.
▲
by
tel
11y ago
Not perhaps what you're looking for but the whole style of fairly zany intro guides began with "Why's Poignant Guide" for Ruby. http://mislav.uniqpath.com/poignant-guide/
988.
▲
by
tel
11y ago
You'd have to be able to generate some pretty fantastically unique hash collisions!
989.
▲
by
tel
11y ago
I'm curious about the decision to elide the synthetic event system. Does Segment only target modern browsers? What is the compatibility delta on including or eliding synthetic events?
990.
▲
by
tel
11y ago
It's mostly unrelated. Mercury is a collection of libraries together which can be used as a framework. The most comparable subcomponent of mercury to deku is virtual-dom. Comparing virtual-dom and deku is pretty simple: v-d is not &quo
More ›