Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nrinaudo
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
61.
▲
by
nrinaudo
11y ago
I don't think so, but I'd be happy to be proven wrong. If you have a function that expects a type A, and you want to pass an object of type B that doesn't have A as a supertype, I don't know of many ways to do so. Either
62.
▲
by
nrinaudo
11y ago
I've heard various CS teachers say that, when presented with Haskell as a first language, students took to it like a fish to water and could start writing useful code really fast. My personal experience is that Haskell isn't reall
63.
▲
by
nrinaudo
11y ago
That sounds like a perfect use case for type classes, have you tried that? If so, I'd be interested to know why it failed, if you can find the time.
64.
▲
by
nrinaudo
11y ago
You do, and I really, really dislike doing any serious work without a solid type system.
65.
▲
by
nrinaudo
11y ago
I agree that duck typing is rarely critical, you can always work around it when you find you'd like to have it. On the other hand, I disagree with the scenario you describe: if you have multiple types that come from an external, close
66.
▲
by
nrinaudo
11y ago
I know next to nothing about Go, but I think you're referring to the fact that it has some sort of implicit inheritance resolution - if there is a Reader interface with a read method, and a type A that has a read method with the same s
67.
▲
by
nrinaudo
11y ago
Oh, right, I never realised that structural typing was static duck typing! Scala has it too, even if it's frowned on. Thanks for enabling me to make the connection!
68.
▲
by
nrinaudo
11y ago
There is one other undeniable advantage to dynamic languages: you can express things in a dynamic language that you can't in a static one. Static languages try to be as sound as possible, at the cost of some completeness. Dynamic langu
69.
▲
by
nrinaudo
11y ago
Not saying I agree, but there is this notion that "proper" CS students are interested in CS for its own sake - they're meant to find algorithms and data structures and programming paradigms inherently fun and interesting. Web
70.
▲
by
nrinaudo
11y ago
I fear I must be misunderstanding your points. Are you really stating that, in order to know what you can do with data, you need just need to inspect it at runtime ? Or that types only protect you from typos? Types allow the compiler to do
71.
▲
by
nrinaudo
11y ago
Ah, good to know, thanks for pointing that out.
72.
▲
by
nrinaudo
11y ago
I feel get is acceptable style if you actually want to fail when there is no data to be had. If you don't have a default value to provide, nor an alternate code path other than "sod this, I'm bailing", get is ok. Not qui
73.
▲
by
nrinaudo
11y ago
I disagree with some of your points. The fact that you can get a null instance of Optional is not Java specific - Scala has the same issue, for example. Saying that Optional does not sort any problem because there is no way to enforce it ca
74.
▲
by
nrinaudo
11y ago
It could also be, and I know that this is something of a radical opinion, that being a parent makes (some) people happy? That the long nights and loss of freedom are offset by the moments of pure happiness that a kid brings? I mean, you app
75.
▲
by
nrinaudo
11y ago
Duplicate of https://news.ycombinator.com/item?id=10114767
76.
▲
by
nrinaudo
11y ago
I think the playground is probably its most unique feature. Other languages have it, but they're either too heavy to be practical (scala worksheets), embedded in a browser (python), or just not languages I care to work with (Swift). I
77.
▲
by
nrinaudo
11y ago
Well, not exactly. If people truly followed the standards, there would be no need for the meta charset element: the RFC clearly states that encoding should either be specified in the header or default to iso latin 1. I can't recall whe
78.
▲
by
nrinaudo
11y ago
That is, as far as I know, not true. If your file is in html5, then all browsers will assume a default encoding of utf-8, which is what you should be using anyway - unless you have a very good reason, such as your file contains a majority o
79.
▲
by
nrinaudo
11y ago
While this is true, I find the meta tag to be a horrible pain in the ass. If you have to parse some HTML that you get over an HTTP connection - you're writing a crawler, say, or you want to extract RDFa metadata, you have to deal with
80.
▲
by
nrinaudo
11y ago
It is possible that he's referring to mutable and covariant types being unsound. As an example, let's assume that you have two classes, Cat and Dog, both inheriting from Animal, and that you have a covariant mutable List implement
81.
▲
by
nrinaudo
11y ago
Higher-kinded types themselves, not necessarily, but the abstractions they afford are, once you've gotten used to them, a huge time saver. I've gotten used to handling concurrency as a monad, for example, and honestly dread the ti
82.
▲
by
nrinaudo
11y ago
Is this why I don't see you there anymore? This has in my opinion made #scala a markedly less pleasant place to hang out.
83.
▲
by
nrinaudo
12y ago
I'd be interested in benchmarks comparing this and ToKuMx - from what I understand, ToKuMx is supposed to have much better read performances than mongodb 2.x, and this new release doesn't mention anything about improving this. ToK
84.
▲
Ask HN: What's your coding setup like?
3 points
by
nrinaudo
12y ago
|
2 comments
85.
▲
by
nrinaudo
12y ago
While Functional Programming in Scala is great, it focuses on areas of Scala that I think are better tackled once you're more familiar with the core language - pattern matching, traits, case classes, variance, for comprehensions... I f
86.
▲
by
nrinaudo
12y ago
I'll be using pseudo code and skip over some technical details that are entirely irrelevant to this conversation in my answer. I hope I understood your question correctly and not answering something else entirely. First, a functor does
87.
▲
by
nrinaudo
12y ago
It also takes bloody ages getting to the "good" parts like monoids and functors :)
88.
▲
by
nrinaudo
12y ago
if f is an isomorphism between A and B, it simply means that there exists f-1 such that f(f-1) = idB and f-1(f) = idA. I don't think anything in this definition allows us to conclude that there can only be one such f between A and B. I
89.
▲
by
nrinaudo
12y ago
It's the only one that does not require knowledge of other fields - not everyone knows set theory (although yes, almost everyone here probably knows enough). Conceptual Mathematics needs concrete example to explain the algebra of fun
90.
▲
by
nrinaudo
12y ago
Well, they're a bit weird. I'm not sure why the signature of map magically changes between slide 91 and 92 and find it very confusing. Slide 90 is straightforward: Functor is a trait (sort of like an abstract class) that takes a t
More ›