Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ernst_klim
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
59 ms
·
601.
▲
by
ernst_klim
10y ago
Visitor is just a collection of functions for all type's subtypes. The problem is that visitor knows nothing about class' subtypes, just like the base class knows nothing about it's children, so you have to add visit cases ma
602.
▲
by
ernst_klim
10y ago
>How is this not exhausted? If you would remove FSpecialization(Expression e1, Expression e2) a.k.a wildcard pattern, compiler would not warn you about your dispatching is not exhaustive. And if you'd add another type of expression,
603.
▲
by
ernst_klim
10y ago
Yep, there is no way to check the exhaustiveness in the compile time. Say you have an Expression parent class and a list of child classes: say Add, Const, Var, and a corresponding visitor. Add new child class, and the visitor would be non-
604.
▲
by
ernst_klim
10y ago
> multiple dispatch > "I don't want to implement the visitor pattern" Both multiple dispatch and visitor bring type unsafe dynamism and possible runtime errors. Pattern matching and algebraic types fit well into static
605.
▲
by
ernst_klim
10y ago
>Readline is a library that adds a line editor to a REPL. There is a great advanced REPL for OCaml if you need something beyond simple stuff: https://github.com/diml/utop
606.
▲
by
ernst_klim
10y ago
() is just an empty tuple, so yes, you can write let f () =...
607.
▲
by
ernst_klim
10y ago
I know, I've asked about this: >The way argumentless functions must be declared with "function". function is just a sugar for fun+match, what does it have to do with argumentlessness?
608.
▲
by
ernst_klim
10y ago
>The way argumentless functions must be declared with "function". Could you show an example, I don't get it? >The expression termination issue (";;") Strange, I've never used ";;" in my code, on
609.
▲
by
ernst_klim
10y ago
>I find OCaml's syntax to be quite gnarly What's wrong with the OCaml syntax? It's much more clean than say scala's one, it's indentation insensitive, and a' list feels more relevant than the list<'T
610.
▲
by
ernst_klim
10y ago
>but it seems we're stuck with developing for two separate Linux environments Why should we do that? Both Qt and Gtk+ looks nice in gnome, so you could choose more suitable for you.
611.
▲
by
ernst_klim
10y ago
It was inevitably. Canonical is too small compared to RH, they have no resources to make something as huge as gnome/wayland/libinput stack by themselves. I'm happy to know that we have a default DE now.
612.
▲
by
ernst_klim
10y ago
>I'm sorry for you not being able to enjoy this. I'm not against allusions and references if they do their job i.e. being a method of art. References are good and appropriate in the Ulysses or Eco's books, but in this movi
613.
▲
by
ernst_klim
10y ago
>The highly praised philosophical content is ridiculously short. >Did you (and all the critics going this way that I guess will become the mainstream) even see the '95 movie recently? The most sad thing is that the authors of the