Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Tarean
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
24 ms
·
211.
▲
by
Tarean
10y ago
Actually, the code "branches" four times. Three times you introduce possible failure, the original parse as well as each call to flatMap. It flattens each of these possible failures into one, though, so you don't have to thin
212.
▲
by
Tarean
10y ago
Nice because it is readable but I generally dislike clever/elegant solutions for fizzbuzz. Here is my own clever haskell solution: module Raindrops (convert) where import Control.Monad (liftM2) import Data.Foldable(fold) impo
213.
▲
by
Tarean
10y ago
Also, when using his amazing git plugin (fugitive) to commit you get very useful highlighting when you break these conventions. http://i.imgur.com/8ix5JGa.png
214.
▲
by
Tarean
10y ago
There were also some games where the player just runs faster when holding both w and up arrow on the keyboard plus forward on the controller. Not that anyone but speed runners actually would do this to themselves.
215.
▲
by
Tarean
10y ago
In rust you can use pattern matching in arguments: struct Foo { x: f64, y: f64, z: f64 } fn length(Foo {x, y, z}: Foo) -> f64 { (x*x + y*y + z*z).sqrt() } ...Doesn't work with `self` because that would be im
216.
▲
by
Tarean
10y ago
It is basically a hack to export the type but not the type constructor. It stops people from doing things like let new_socket = OpenSocket { port: 12 };
217.
▲
by
Tarean
10y ago
I mean, pressing the button to collapse the documentation isn't very hard http://i.imgur.com/rcI3JG5.jpg I never had to print an osstr yet but it seems fairly straightforward when looking at the docs? There are three o
218.
▲
by
Tarean
10y ago
There are basically three ways to do meta programming in nim. Simple replacement of tokens: const debug = true template log(msg: string) = if debug: stdout.writeLine(msg) You could also use other concrete types, generics
219.
▲
by
Tarean
10y ago
It gives a pretty facinating point of view onto computation in general. You only the ability to define and call functions. Functions can only recombine their input. And somehow it is still as powerful as, say, python! Don't need some b
220.
▲
by
Tarean
10y ago
Very cool. I always wanted to play around with a git provider for powershell. Powershell's syntax is great for queries and you could use everything that works on the normal file system with anything that has the abstractions implemente
221.
▲
by
Tarean
10y ago
The simplest example would be a persistent list. Think you first create a list [c,d,e]. You can safely share references to that. Then you attach a to one version and b to another: a \ c-d-e b / The memory for the o
222.
▲
by
Tarean
10y ago
But at least they shouldn't use phrases like `persistent sets` in the documentation. I confused that with the datatype on my first reading. Technical details are necessary but that is just creating unnecessary confusion. Compare that t
223.
▲
by
Tarean
10y ago
It is very close to vi/vim's philosophy - different modes for different task, key bindings are mnemonics, you combine basic commands to more complex tasks. Even window manipulation is the same with the hierarchy of content->s
224.
▲
by
Tarean
10y ago
Do you happen to know how japanese input methods generally work? I have seen chinese and japanese steno machines before, e.g. chorded strokes that cover one or more sillables. That takes specific hardware and a bunch of training, though, so
225.
▲
by
Tarean
10y ago
It is much more like haskell's pattern matching. Notably it handles tagged unions (in rust enum). Here is a good example from the [book]( https://doc.rust-lang.org/book/match.html ): enum Message { Qui
226.
▲
by
Tarean
10y ago
I think for many that is a hard drive thing combined with dozens of tool bars, though. Phones have solid state memory so that shouldn't be a major problem.
227.
▲
by
Tarean
10y ago
That is odd, powershell shells out to cmd.exe if you try to pipe binary or text data. It goes back to powershell only if you use powershell commands in the pipeline. If you don't pass the flags zo handle it as binary in those cases stu
228.
▲
by
Tarean
10y ago
Currently powershell just shells out to cmd.exe to run normal command line apps And handle text streams anyway. How would that work?
229.
▲
by
Tarean
10y ago
No, dir `c:\ works` just fine. It is a short version for Get-ChildItem -Directory C:/
230.
▲
by
Tarean
10y ago
I only used nim for some side projects but the only times I saw this used anywhere is in FFI bindings. That way you can mirror, say, C style while writing the bindings either manually or automatically and use them as if they were normal nim
231.
▲
by
Tarean
10y ago
Actually, I think untranslated features are already lart of the game.
232.
▲
by
Tarean
10y ago
Didn't this happen for spellings in various ortography reforms? I think german had the largest one in recent years and iirc there was a deprecation period for old spellings. An English spelling reform would be a blessing but almost cer
233.
▲
by
Tarean
11y ago
It is more that unix shells are built on piping and piping is systematically broken in unix shells. It just becomes extremely obvious after using for powershell for any time which doesn't require most of the work to scrap and rewrite o