Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tel
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
66 ms
·
631.
▲
by
tel
11y ago
Yup, forgot pass-pass!
632.
▲
by
tel
11y ago
As I remarked elsewhere, what was more interesting to me was that the 2x2 board has hundreds of billions of games (assuming a superko, I suppose). It's easy to recognize that there must be a lot of them, but hundreds of billions is abs
633.
▲
by
tel
11y ago
As someone who plays currently and is very far away from dan... this board is immediately random looking.
634.
▲
by
tel
11y ago
That's nice, but I wouldn't call it particularly core to ADT systems. It also requires quite a bit more machinery to embed directly since you need to be able to talk about functors/containers.
635.
▲
by
tel
11y ago
Ah, thanks!
636.
▲
by
tel
11y ago
That just seems broken? If `f` is Function<T, S> then given `T src`, like we have, then f.apply(src) has type S. But Extension.this.apply is applied to values of S even though T is the thing qualified as an Extension. Actually, I'
637.
▲
by
tel
11y ago
Ah, gotcha. Thanks!
638.
▲
by
tel
11y ago
Oh sure, you can call them whatever you like. But if you have an ADT system which has a unit type that isn't quite the empty product then you'll be in for an interesting time at least. E.g., this is true in Haskell and it causes t
639.
▲
by
tel
11y ago
What makes them weak?
640.
▲
by
tel
11y ago
You probably also want to complete your toolkit with functions which are then exponentiation. Also, in any ADT system 0 should be exactly the empty sum and 1 exactly the empty product. This is what makes things hang together properly.
641.
▲
by
tel
11y ago
You should read up on Agda. Its standard library [0] does all this. [0] http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Libraries.S...
642.
▲
by
tel
11y ago
I really like that metaphor!
643.
▲
Functional Programming, Abstraction, and Naming Things
(stephendiehl.com)
92 points
by
tel
11y ago
|
19 comments
644.
▲
by
tel
11y ago
Yup. Here's an example. There is no function print :: String -> () (The type () implies "no interesting return value"). This function could only be written via deliberate subversion of the type system. Instead it
645.
▲
by
tel
11y ago
It turns out that priors don't actually need to be distributions all the time. This often occurs when seeking maximally "uninformative" priors.
646.
▲
by
tel
11y ago
He's complaining about mutable state, essentially. The function `f` captures reference to `i` but does so transparently. One might expect that `f` would be free of side effects, but since `i` can be re-bound whenever this is not the ca
647.
▲
by
tel
11y ago
There's honestly nothing less mathematical about those domains. The structures of rules and exceptions are mathematical. Business Prolog ideas like Drools are one attempt to systematize this, but others could exist. Typically busines
648.
▲
by
tel
11y ago
Sure, but there are a lot of them, they involve several layers of metaheuristics to balance different approaches, and nobody has been able to automatically grow something which matches the same success rate as highly trained human heuristic
649.
▲
by
tel
11y ago
"Initial" usually means "the initial algebra over a functor". This means that for some functor f the algebra `i : f (Initial f) -> Initial f` is initial in the category of f algebras. This means that for any X and `g
650.
▲
by
tel
11y ago
I program like this all the time in Haskell. Much of the latter bits can be replaced by so-called "mtl-style" typeclasses (used similarly to Oleg's Finally Tagless idea). I have a brief talk on this at last year's Lambda
651.
▲
by
tel
11y ago
There has to be an RTS interface. Right now this is "there exists a value called main in the Main module of type IO which the RTS magically understands". This is annoying because it moves so much of IO's reasoning into &quo
652.
▲
by
tel
11y ago
Note that there's a bit of a pun here. "Finally" tagless isn't really any less initial than free monads are. The final encoding would give us something codata like, not just described via a typeclass. That said, both are
653.
▲
by
tel
11y ago
Of which there are usually far fewer and of which we can recursively apply ML techniques to fit. So yeah, but it works really well.
654.
▲
by
tel
11y ago
There's a "Core" output option which is not far from STG if I remember right.
655.
▲
by
tel
11y ago
The Haskell standard is, for great reason, rather conservative. Lots of extensions to the 98 and 2010 versions are popular, valid, and battle tested. Not all code requires them so there's little chance they will be incorporated, but th
656.
▲
by
tel
11y ago
Hard to imagine not mentioning GADTs!
657.
▲
by
tel
11y ago
It's related. One way to see monads (but don't take this for a tutorial or the "one true way" or anything like that) is as a special data type which captures the binding structure of a language. They have good "gene
658.
▲
by
tel
11y ago
That's one way of doing it, but most formally I think it has to do with whether you're considering the list type in a "data" sense or a "codata" sense. In either case you might be talking about the same "s
659.
▲
by
tel
11y ago
It's not really lazy by default, it just has a lazy stream type with nice syntax.
660.
▲
by
tel
11y ago
I don't think this is really surprising. I don't know a ton about distributed systems, but the last time I read up on formalizing them and proving properties it seemed like an incredibly daunting task. There's an exponential
More ›