Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
whateveracct
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
271 ms
·
3421.
▲
by
whateveracct
11y ago
While not every build needs to be optimized to the fullest extent possible, every build needs to be checked for correctness to the fullest extent possible. And since Rust does so much more than Go in terms of correctness, it's probably
3422.
▲
by
whateveracct
11y ago
Monoids are much easier. You just need a binary associative operator |+| (+,*, min, max all work for ints, ++ for lists/vectors, for instance) and some notion of an identity for the type s.t. forall a: A, a |+| identity === identity |+
3423.
▲
by
whateveracct
11y ago
Not quite ;) Semigroups are defined by their associative, binary operator of type a -> a -> a. Monoids are that plus an identity value of a.
3424.
▲
by
whateveracct
11y ago
Joinable would be a much better name than FlatMappable. FlatMap makes it apply too much to collections.
3425.
▲
by
whateveracct
11y ago
It looks like this just needs a jar, so any JVM language with better FP support would also work. There is a limit on JAR size though: > Note that deployment packages uploaded to Lambda are limited to 50 MB
3426.
▲
by
whateveracct
11y ago
> But I also think they may help up to a certain point and then start hurting. The problem is, this has never been put to the test. You're right that the current cutting-edge of types in programming haven't been put to the test
3427.
▲
by
whateveracct
12y ago
But there is for float64 ;) I think this is a classic case of Go's need for "simplicity" hamstringing the language. When handling min/max, they had a few options: 1) Treat numbers as a special case and have a polymorphic
3428.
▲
by
whateveracct
12y ago
Pokemon rules would probably be wonderfully modeled as ADTs. Every "modifier" could be in a big sum type and then you would just express all your rules explicitly in terms of the current modifiers in play along with pokemon stats,
3429.
▲
by
whateveracct
12y ago
Or just architecting something in general. This talk [1] proposes a way to approach application architecture that will result in the programmers writing their own monads (or rather, their own FREE monads) [1] video: https://www.p
3430.
▲
by
whateveracct
12y ago
That's because the Scala stdlib doesn't abstract over things that can be mapped over. If you want to do that, then you need a typeclass. Scalaz has a typeclass for mappable things and it's called Functor.
3431.
▲
by
whateveracct
12y ago
Go seems like a terrible choice for any programming problem that requires data modeling/manipulation. Basic structs, slices+maps, and loops are all you have. Go is good at plenty of things, but building abstractions is not one of them.
3432.
▲
by
whateveracct
12y ago
You're the top post of this HN thread but you're making sweeping statements of fact about Haskell and other topics you clearly don't have a working understanding of. You should edit your comment so as not to mislead people ab
3433.
▲
by
whateveracct
12y ago
Nitpick, but Clojure's startup time isn't JVM startup time it's clojure.core startup time
3434.
▲
by
whateveracct
12y ago
Since OCaml doesn't have first-class higher-kinded types in the way Scala and Haskell do, I didn't think it would be acceptable by ekmett standards.
3435.
▲
by
whateveracct
12y ago
Sure maybe it's not good for FP if you're Edward Kmett. > The reason, I'm hesitant to give it a fifth star is ultimately that I don't believe that Scala is a good language in which to actually do functional programmin
3436.
▲
by
whateveracct
12y ago
I've seen people say this but never any real source. Maybe they're mixing up Twitter and Linkedin?
3437.
▲
by
whateveracct
12y ago
Apache Spark is written in Scala. Whitepages is also Scala. That's off the immediate top of my head.
3438.
▲
by
whateveracct
12y ago
> How often do you need laundry detergent? Every two weeks? If this button saves you ten seconds each time, that's a total of 4.3 minutes per year saved It takes more than 10 seconds to go to the store and get detergent. I suppose i
3439.
▲
by
whateveracct
12y ago
fake hype; not from google: > This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.
3440.
▲
by
whateveracct
12y ago
Can people really not decouple the words "for" and "yield" from other languages and just understand how a scala for-yield is desugared? Writing Scala and avoiding for-yield for the reason of it being superficially confus
3441.
▲
by
whateveracct
12y ago
Good point I was sloppy in my reading. def getAddress(name: String): Option[String] = { for { elem <- database.get(name) nullableAddress <- elem.data.get("address") address <- Option(nu
3442.
▲
by
whateveracct
12y ago
The monadic chaining section makes no mention of for-yield strangely enough. Their example def getAddress(name: String): Option[String] = { database.get(name).flatMap { elem => elem.data.get("address")
3443.
▲
by
whateveracct
12y ago
F# won't draw especially draw people away from those three languages though. It doesn't have the sort of type system Scala and Haskell people love, it isn't a Lisp or dynamically typed so most Clojure people won't care,