Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bPspGiJT8Y
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
bPspGiJT8Y
2y ago
I'd like to believe this too, but given that medieval peasants and antique slaves worked more or less the same hours as we do I'm quite pessimistic. Whenever we automate something they just come up with a new bullshit job that add
2.
▲
by
bPspGiJT8Y
2y ago
> And defining a function that will only accept particular variant is nice This is possible to achieve (or hack your way through, if you will) by parameterizing the type and using a nullary type (a type which is impossible to have) to ex
3.
▲
by
bPspGiJT8Y
2y ago
It is well known that Binance, among many other crimes, runs many internal trading desks which trade against Binance's own customers.
4.
▲
by
bPspGiJT8Y
2y ago
> so I eventually gave up and just made fish itself my nushell's completion engine That's an interesting idea. Do you have a link to show how you did this?
5.
▲
by
bPspGiJT8Y
2y ago
> BTW I believe `-C` will disable some cache checking, caching is enabled by default You're right, my memory has let me down. > Do you have any pointers for the "load on tab" idea? I didn't turn up any good results
6.
▲
by
bPspGiJT8Y
2y ago
> much faster than zsh script completions I'm curious where did you get that from. Edit: I read the note in your dotfiles repo. Yes calling `compinit` on each shell invocation is going to be really slow. That's not how you'
7.
▲
by
bPspGiJT8Y
2y ago
I'm shifting towards simply "not having" a home directory. Actual data is stored on other partitions, eg `~/git/project1` => `/git/project1`, `~/Pictures/Wallpapers` => `/data/Pic
8.
▲
by
bPspGiJT8Y
2y ago
Not fast at all in my experience. Just running (for the first time) what would take seconds with something like `asdf` could take up to half an hour with Nix.
9.
▲
by
bPspGiJT8Y
2y ago
Gnome terminal would also need some unicode handling improvements, its current score in `ucs-detect` rating is D-[0]. [0] https://ucs-detect.readthedocs.io/results.html
10.
▲
by
bPspGiJT8Y
2y ago
This function would use an anonymous record: splitString :: { pattern :: String, string :: String } -> Array String splitString { pattern, string } = ... This function would use positional arguments: splitString :: Pat
11.
▲
by
bPspGiJT8Y
2y ago
> Because possibly you return the partial assuming it's a number, and try to use it somewhere else, possibly even in another file. Sorry, I must've been more explicit instead of implying certain usage patterns. What I meant her
12.
▲
by
bPspGiJT8Y
2y ago
I don't really understand the distinction between "multi-arity" and "unary" functions. In my mental model, all functions are unary, it's just that in "traditional", non-FP languages it's more com
13.
▲
by
bPspGiJT8Y
2y ago
> What if you forget, not in quotes, to give the second argument? I will get a type error and it will take me 2-3 seconds to figure out what it is about. > Why on earth would you want to get a type error in a completely different part
14.
▲
by
bPspGiJT8Y
2y ago
In Gleam it also seems to be done well: https://tour.gleam.run/functions/function-captures/
15.
▲
by
bPspGiJT8Y
2y ago
> After like ten or fifteen hours of trying to understand what currying is, I still have no idea Maybe you could recall which learning materials you used?
16.
▲
by
bPspGiJT8Y
2y ago
Tree-sitter optimizes for performance (to use in editors), not for correctness. In fact even TS' core developers advocate for not bothering too much with correctness of grammars[1]. I imagine this constraint would be a deal-breaker for
17.
▲
by
bPspGiJT8Y
3y ago
> If you have pickRandom<A|B, B|C> x y you would get nested Either's If this wasn't the case, how would the information about what you got be retained? It's either positional, or by a tag/key (row-polymorphic va
18.
▲
by
bPspGiJT8Y
3y ago
> Either<Either<A,B>,A>> doesn't express our intent for a function return or parameter type if we don't care about the position of A, just whether it is an A > so we'd want all nested variations normalize
19.
▲
by
bPspGiJT8Y
3y ago
So basically the idea here is that you want to have TS-style untagged unions, but instead they're also tagged, but still unify and compose the way they do in TS? Then why couldn't you just do `{ tag: A, data: … } | { tag: B, … } |
20.
▲
by
bPspGiJT8Y
3y ago
> Because your code might not need to care about the position you insert your A or B This is understandable. But what does it have to do with "collapsing" `a | a` into `a`? Throughout your post I think you're talking about
21.
▲
by
bPspGiJT8Y
3y ago
You can try Kakoune or Helix.
22.
▲
by
bPspGiJT8Y
3y ago
There's also a Chez backend in development for PureScript.
23.
▲
by
bPspGiJT8Y
3y ago
> because Either<A, Either<A, B>> cannot type check as Either<A, B> Why would you want the former to type check as the latter? Where do you see the complexity?
24.
▲
by
bPspGiJT8Y
3y ago
> To be concrete, I am talking about tagged, disjoint union type But you just said "For example `A | B | A` is the same type as `A | B`". How would this be possible for tagged union types? > that does not require naming a ne
25.
▲
by
bPspGiJT8Y
3y ago
So you're talking about untagged unions? > This is useful as a shorthand when you don't want/need a new type to represent your problem, similar to tuples. Yes this is handled perfectly by the generic sum type, you don'
26.
▲
by
bPspGiJT8Y
3y ago
> They are to enums what tuple types are to structs. But this is just a generic sum type? data Sum a b = L a | R b infixr 5 type Sum as ⊕ type E₂ a b z = a ⊕ b ⊕ z type E₃ a b c z = a ⊕ b ⊕ c ⊕ z -- and so on… H
27.
▲
by
bPspGiJT8Y
3y ago
fact n = do let n' = n - 1 if n <= 1 then 1 else n * fact n' Here you go. Not sure about Haskell but in PureScript it compiles. Use "<-" for functions which return a value in IO type constructor, ot
28.
▲
by
bPspGiJT8Y
3y ago
> How would you create a non-strong monad in Haskell, and why might you want to, or is it impossible? I think the article implies it clear enough that it's impossible. Even if your monad has nonsensical (but lawful) semantics like `
29.
▲
by
bPspGiJT8Y
3y ago
I got curious and decided to google around. I din't find anything from Pike specifically, but my overall impression is that the maintainers simply refuse to see significant value in sum types. They do acknowledge the benefits but not t
30.
▲
by
bPspGiJT8Y
3y ago
Safe destructuring could be achieved with Church encoding.
More ›