Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
throwaway487549
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
1.
▲
by
throwaway487549
8y ago
I would love to have type-clases a-la Haskell (implicits with parametric polymorphism, which is dead-simple and well understood) and universal pattern matching everywhere, but this is, of course, just a dream. I would love to have ML/S
2.
▲
by
throwaway487549
8y ago
Yes, it was really good read, thank you. I hope I could write as clearly. Look, however, at the use of "is" in my comment and yours. You are applying "is" to some abstract, nonexistent categories, categorizing abstractio
3.
▲
by
throwaway487549
8y ago
Promises and futures in Scala standard library and in Akka have nothing to do with Monads.
4.
▲
by
throwaway487549
8y ago
May be. I think a Monad is an abstraction which generalizes a transition, similar to a step of logical deduction. It Haskell a similar concept is actually used to compose what they call actions, originally used to implement IO. Out of this
5.
▲
by
throwaway487549
8y ago
> there is no other way to talk about values that have not been evaluated yet. There is a way, and it is known since at least R5RS. https://www.gnu.org/software/mit-scheme/documentation/mit-sc...
6.
▲
by
throwaway487549
8y ago
To be a Monad you have to implement at least 2 functions >>= , and return , which must follow so called Monadic laws (of proper composition - associativity, etc). flatMap is just a function. One more time - Futures are orthogonal
7.
▲
by
throwaway487549
8y ago
> JS is a strongly typed Strongly typed implies no implicit coersions at runtime. Python is strongly typed. JS or PHP are weakly typed.
8.
▲
by
throwaway487549
8y ago
And this is meaningful only in the context of a lazy language. In the context of strict, statically typed language an algebraic Option type is good-enough.
9.
▲
by
throwaway487549
8y ago
This isomorphism has no meaning. It is also isomorphic to logical OR, if you wish. Shall we wrap OR into a Monad?
10.
▲
by
throwaway487549
8y ago
That means they do meaningless unnecessary wrapping too. It is even more ridiculous for a weak-typed language. The only point of a Monad is that in a lazy language it desugars into an implicit nested functions, which guarantees the order of
11.
▲
by
throwaway487549
8y ago
Option type is just an algebraic data type. datatype 'a option = None | Some of 'a