Is this supposed to illustrate a contradiction? I don't see any.
-
-
Replying to @dfacastro @dmitriid
Or perhaps I didn't explain myself correctly. `x = readLn; [x, x]`, by itself, will NOT perform any side effects. `[x, x]` is an expression of type `[IO String, IO String]`, and that's all it is.
2 replies 0 retweets 1 like -
Replying to @dfacastro
By itself readLn in Java will not do anything either. Because a program that isn’t run doesn’t do anything. As soon as you *run* it, no difference. Even the expectations and reasoning is exactly the same as in any other labguage with HoFs
1 reply 0 retweets 0 likes -
Replying to @dmitriid
I've gone through this before but ok: Java's `readLn` is equivalent to Haskell's `readLn`. And Java's `readLn()` is equivalent to Haskell's `unsafePerformIO readLn`. Difference is, you write readLn() all the time in Java, but you never write `unsafePerformIO readLn` in Haskell.
1 reply 0 retweets 1 like -
Replying to @dfacastro @dmitriid
You *can* write pure FP in Java, but you'll be fighting the language every step of the way.
1 reply 0 retweets 1 like -
Replying to @dfacastro
Why? Ok, not Java but JS. Or Erlang. Anywhere you have HoFs basically (so, even Java)
1 reply 0 retweets 0 likes -
Replying to @dmitriid
I can't speak for erlang, but java lacks even the most basic foundations for pure FP. You can't even combine a nullary function (Supplier<A>) with a unary function. I suspect js is equally handicapped.
2 replies 0 retweets 1 like -
Replying to @dfacastro @dmitriid
A lot of really smart people have put a lot of effort into building those foundations, and IIRC the conclusion was that it was like putting lipstick on a pig. Maybe
@dibblego can fill you in on that.1 reply 0 retweets 0 likes -
Replying to @dfacastro @dmitriid
We wrote http://functionaljava.org/ in mid-2000s. We did a lot better than predicted. But it is still terrible. It was successful in teaching and transferring concepts. /cc
@runarorama1 reply 0 retweets 0 likes -
Java has become better since then :) (of course, there’s still a lot of room for improvement)
1 reply 0 retweets 0 likes
Actually, it's become worse. It was better in 2008, when it had better lambdas, and other important bits. http://javac.info/ Now it has a broken Optional (we wrote it in 2005) and sub-standard lambdas, which even if fixed, is nowhere near minimums.
-
-
Ah, I realized I missed this in mid-to-late 2000s. Was busy doing Erlang ... and PHP :) Why oh why can’t we have all the good things :(
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.