Re:PullRequest pulls in $8M Series A just months after scori...
by aassddffasdf on Friday April 13, 2018 @08:07PM
(#16834987)
That is not what is meant by "idioms and stylistic aspects". Take, e.g. `o.map(v => ...).getOrElse(v2)` vs `o match case Some(v) => ... case None => v2`. The former is idiomatic and preferred over the latter (but of course some jackass somewhere will disagree and argue incessantly about it).
[ Parent
| on HN ]
Re:PullRequest pulls in $8M Series A just months after scori...
by kornish on Friday April 13, 2018 @08:11PM
(#16835011)
Exactly right. I'm not referring to which line the braces go on, but rather how domains get modeled, how errors are handled, how functional or imperative the code is, etc.
Re:PullRequest pulls in $8M Series A just months after scori...
by paulddraper on Saturday April 14, 2018 @09:50PM
(#16840644)
Side point, but AFIAK `fold()()` is most idiomatic in Scala.
Re:PullRequest pulls in $8M Series A just months after scori...
by Nullabillity on Sunday April 15, 2018 @04:47PM
(#16844863)
And yet, `match` is the only one that gets correct type inference.
`.map(ifSome).getOrElse(ifNone)` infers the type from `ifSome`, and forces `ifNone` to conform.
`.fold(ifNone)(ifSome)` infers the type from `ifNone`, and forces `ifSome` to conform.
Meanwhile, `match { case Some(x) => ifSome(x); case None(x) => ifNone }` will correctly infer from both cases at once, and give you the greatest common ancestor.
Re:PullRequest pulls in $8M Series A just months after scori...
by paulddraper on Tuesday April 17, 2018 @06:19PM
(#16862806)
Yeah, I agree. ¯\_(ツ)_/¯