Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
quchen
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
24 ms
·
211.
▲
by
quchen
11y ago
Wow, I would not have thought Russia and China to be comparable in size. Yes, Russia is still bigger than China, but nowhere near as giant as the map makes it appear.
212.
▲
by
quchen
11y ago
I think your post only takes non-null values into account, which is what OP seems to talk about. What would this code do? Optional<Int> foo = null; foo.flatMap(x -> Optional.of(x)); Obeying the Monad laws would mean ge
213.
▲
by
quchen
11y ago
join is one possible fundamental monadic operation. You can also define monads in other ways, such as endofunctors such that the Kleisli structure forms a category. In this case, you have the identity arrow (called return in Haskell) and
214.
▲
by
quchen
11y ago
"flatmap" hints at it consisting of two components, flattening and mapping. Both are to be seen in a generalized context though, and the words are familiar to many when thinking about collections. 1. Mapping - the same as what Fun
215.
▲
by
quchen
11y ago
> Haskell is a research language The language standard is from 1998, and is mostly unchanged since then. We now have Haskell 2010 and quite a few compiler extensions, but none of the experimental ones are necessary to be used in producti
216.
▲
by
quchen
11y ago
A bit of context would be nice. Is this the go-to book to learn SML, or just a random source? SML has been on the higher ranks of my to-learn stack, because apparently it has some nice features Haskell does not, most notably I've heard
217.
▲
by
quchen
11y ago
You're correct on the theoretical side, and writing a value whose type makes GHC crash is fairly easy. But in multiple years of Haskell, I did not encounter nor have I heard of a practical case in which type inference time was a perfor
218.
▲
by
quchen
11y ago
PDF version: http://delivery.acm.org/10.1145/2670000/2663341/p48-preibusc...
219.
▲
by
quchen
11y ago
I wouldn't call ML popular, and in Haskell you have type classes, which have undecidable type inference. You can write `show (read str)` in Haskell for example, which parses `str` and then converts it back to `String` again. But the co
220.
▲
by
quchen
11y ago
I don't think type hints do Hindley/Milner/Damas justice. This type system has two parts, none of which are present in most popular languages: 1. A program that typechecks cannot have type errors during runtime. Dynamic type
221.
▲
by
quchen
11y ago
Multiple things at once are still ordinary monads, and you can implement them without using transformers. Transformers are merely the realization that one can put (certain) monads together in a compositional way. An example of a monad in Ha
222.
▲
by
quchen
11y ago
I'm assuming this means the thing with Lenovo didn't go that well, or is it a different company?
223.
▲
by
quchen
11y ago
5) Cost of a normal bike path with ordinary solar cells of equal area next to it
224.
▲
by
quchen
12y ago
I don't see any end-user documentation (only a short building section). Is this not a release, but the project's "work in progress" page?
225.
▲
by
quchen
12y ago
For reverse sorting, there's a type that does specifically that. sortBy (comparing (Down . snd)) See http://hackage.haskell.org/package/base-4.7.0.1/docs/Data-Or...
226.
▲
by
quchen
12y ago
> I wrote this code putting brevity over readability, which is something I usually never do Shouldn't the point of such a post be to show interesting code? I'm having trouble reading through the densely packed source. In additi
227.
▲
by
quchen
12y ago
To be fair, anything that's German and has "BILD" in its name cries out "tabloid".
228.
▲
by
quchen
12y ago
I'm inclined to say "no", but I think most of us have deleted seemingly unnecessary appendices from code to spend a week fixing the aftermath.
229.
▲
by
quchen
12y ago
I don't think that's right. There is a basic theorem in (untyped) lambda calculus that says that if a term has a normal form, then any evaluation strategy, including strict and non-strict, will reduce that term to that normal form
230.
▲
by
quchen
12y ago
Why do you think termination is easier to reason about in eager languages? I think it's quite the opposite: in lazy languages functions compose, in strict ones they don't necessarily. For example, you cannot compose a "take t
231.
▲
by
quchen
12y ago
Capitalization of "fun" makes all the difference when reading stories about it.
232.
▲
by
quchen
12y ago
The backers fund something they think is interesting, and they're certainly aware of that. Most big inventions started as seemingly useless projects that required lots of money. Sure, this is as far away as the Wright brothers from a t
233.
▲
by
quchen
12y ago
Although intuitionistic logic does not have the axiom ------ (LEM) A ∨ ¬A that is, the law of the exluded middle (LEM) can not be derived "from nothing" for all propositions, it is still an inconsistency if you can pr
234.
▲
by
quchen
12y ago
Not informative about TrueCrypt, no. But it's a very telling sign of how people vote here when a zero-original-content article is at the top only because it's by Bruce Schneier (or Linus Torvalds or Joel Spolsky or Steve Wozniak o
235.
▲
by
quchen
12y ago
Before laughing at how stupid this is, remember that your debit card is secured by a password that consists of exactly four decimal digits. I really wonder when this is finally going to change, but I hear some futuristic banks allow up to s
236.
▲
by
quchen
12y ago
Try disallowing Javascript.
237.
▲
by
quchen
12y ago
Learning Agda has quite an academic feeling to it, not because it's not widely used, but because the ressources are so scattered around, often out of scope for beginners, and so on. For that reason, I really appreciate these "let&
238.
▲
by
quchen
13y ago
(Minor nitpick, your definition is `mappend` [1]. `mconcat` is `foldr mappend mempty` [2], i.e. concatenates a list of monoids.) [1] mappend :: Monoid m => m -> m -> m [2] mconcat :: Monoid m => [m] -> m
239.
▲
by
quchen
13y ago
Gabriel is also the author of the popular Pipes Haskell library, and nice person in general. Both of these make me heartily recommend his other blog posts about various Haskell topics, which often portray advanced features remarkably well
240.
▲
by
quchen
13y ago
People ( all people) are fundamentally unsafe, not languages. It may be harder to write safe code in some languages than others, but that arguably doesn't make the language unsafe. Most certainly though, it does not make it "fun
More ›