Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Peaker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
62 ms
·
691.
▲
by
Peaker
13y ago
2. Nullability is an implicit sum you have everywhere . One that is not checked for exhaustiveness by the compiler. What do you mean "a zero value would be impossible"? The whole idea is that sometimes you need it, and sometimes you don'
692.
▲
by
Peaker
13y ago
A bare bones for loop is the implementation of replicateM. There are more complex combinators than replicateM, e.g: filterM, zipWithM, and more... Which you would need more than duplicating a bare bones loop at every occurence. The code I p
693.
▲
by
Peaker
13y ago
I didn't say I was angry. I said a new language that repeats past mistakes again is sad. The authors of Eiffel went ahead and paid a very dear price to fix their nullability-everywhere. The C# author says if he could go back in time and f
694.
▲
by
Peaker
13y ago
> why give myself type system problems too? Exactly! Why use Go and have type system problems? Chase nil bugs in the middle of the night, when my type system could have caught them all for virtually no cost at all? Why use Go and have t
695.
▲
by
Peaker
13y ago
This is called the "Real World" fallacy. Your techniques are unfamiliar to me, and I am in the "Real World", therefore you are an academic who doesn't actually solve real world problems. DSLs are used in production code, and solve real wor
696.
▲
by
Peaker
13y ago
So you're forced to duplicate the monadic combinators (e.g: inlined replicateM here). Now let's consider: myParser = do logDate <- date char ':' logTime <- time let fullTime = fromDateTime logDate logTime msg
697.
▲
by
Peaker
13y ago
> But IMHO, lots of these systems are a little creaky in the support structures (cabal for example) and deploy features Cabal used to be horrendous. Now it's just mediocre, and better than the distribution tools I've seen in the Python
698.
▲
by
Peaker
13y ago
Essentially, you're saying that the point is not to use DSL's. The benefits of DSL's are explained everywhere, so I don't think I need to repeat them here... Parser combinators are not what you said they are -- and you won't be able to wri
699.
▲
by
Peaker
13y ago
How many of today's 90 year old developers have you worked with? Sounds weird to be assessing developers raised in the 1920s.
700.
▲
by
Peaker
13y ago
Continuations are useful monads too (for implementing coroutines or control features like Python's "with", etc). As are parsers, uniqueness, randomness, non-determinism, readers, writers, regions, resource management, local-state threads (S
701.
▲
by
Peaker
13y ago
Those of us who think that Go is a truly sad language to release at modern times (nullability everywhere, no parameteric polymorphism, no sums, products for errors instead of sums, ...) have just lost interest in explaining over and over ag
702.
▲
by
Peaker
13y ago
> Many of the world-changing ideas have been implemented. For many people, what is left but to continually optimize what already exists? This sounds unimaginative to the point of absurdity.
703.
▲
by
Peaker
13y ago
I am not an expert on CUDA, but couldn't you split the file into relatively large chunks, find the nearest newline to the chunk points, re-split on those positions, and use that division of labor?
704.
▲
by
Peaker
13y ago
While you might do so, anyone you collaborate with will probably not do that. Why? Because almost every code editor in existence comes with that option turned off. And many of them don't even have that option at all! If you expect your c
705.
▲
by
Peaker
13y ago
tabs are an infinite source of pain and inconsistencies... Everyone must support the space character, it cannot be banned. But a simple commit hook to ban tabs can make indentation and alignment not get messed up over time with many collab
706.
▲
by
Peaker
13y ago
Another alternative is sharing the types of the various ASTs but using parameterization to distinguish the cases. To restore nice, concise types, use a bunch of type synonyms. While this is slightly cumbersome, I much prefer it over partial
707.
▲
by
Peaker
13y ago
Then python is also a functional language just like cl. Except no-one calls python a functional language, and everyone seems to call cl a functional language.
708.
▲
by
Peaker
13y ago
Or simply: f x y = x + y
709.
▲
by
Peaker
13y ago
It's not really considered "mutation" at all. They just return new values that are related in some way to the input values.
710.
▲
by
Peaker
13y ago
I think recursive solutions are often very nice indeed. But at worst, recursive solutions are sometimes worse than structured loops, because you can use recursions very much like a free-style goto, allowing your code to have even less restr
711.
▲
by
Peaker
13y ago
I don't think CL is a particularly functional language. It is not much more functional than say, Python.
712.
▲
by
Peaker
13y ago
When you say "add complexity", I think you mean "add difficulty". Because for example, a language that has only one-argument functions, and builds multi-arg functions on top is a simpler one than one that has multi-arg functions built-in.
713.
▲
by
Peaker
13y ago
The important thing here is not the wrapping with a lambda. That's not what made it pure. The important thing here is the abstract type wrapper. You're exposing pure primitives that are implemented in terms of (hidden) impure ones. That's w
714.
▲
by
Peaker
13y ago
If you use it a lot it's likely a bad sign. Either that you are not using the type system's power to its full extent, or that the type system is too weak. In Haskell, use of fromJust is considered a code smell, and is of course sometimes
715.
▲
by
Peaker
13y ago
What I was trying to say is that monadic combinators are super-useful in Haskell as they are in Javascript. They're hard to implement in Javascript though, because of return type polymorphism or explicit dictionary passing being required.
716.
▲
by
Peaker
13y ago
If you have: foo (Just a) = bar a It is typically followed, on the next line by: foo Nothing = ... And if it isn't, and you use -Wall (you really should!) you will get a warning for writing a partial function (which is sometim
717.
▲
by
Peaker
13y ago
Maybe a is a value that may or may not contain an a within it. So how would you convert that to an a, which definitely has an a in it? What you can do, is pass a callback to a function that handles the case where you do have an "a" in the M
718.
▲
by
Peaker
13y ago
Simple function composition composes functions. getLine, for instance, isn't a function. There is a big problem that "Monads" can refer to the generalization and combinators that work with any Monad, or to specific Monad types and the sty
719.
▲
by
Peaker
13y ago
getValue kind of defeats the purpose of using Maybe in the first place.
720.
▲
by
Peaker
13y ago
"Pure" typically means referentially transparent. Wrapping a side-effecting procedure in a lambda does not make it referentially transparent, therefore it isn't pure.
More ›