News for hackers. Stuff that matters.
Re:Why Are So Many Developers Hating on Object-Oriented Prog... by ferzul on Friday August 23, 2019 @09:38PM (#20784583)

  module Main {
    IO<Void> main() {
      Integer n <- read$(getLine) // or: fmap(read)(getLine)
      print(fib(n)) 
    }

    Integer fib(Integer n) { 
      Integer go(Integer !n, Integer !a, Integer !b) {
         if (n==0) {
            return 0
         } else {
            return go(n-1, b, a+b)
         }
      }
    }
  }
pros: it looks plausibly like Java. cons: all the things that haskell syntax makes easy like partial application become obscure at best. omg, i'm dying in squiggly and round brackets, what is this, lisp? there's too much stuff that has to become ad hoc builtin syntax, like <$> becomes $(...). i don't know if you can program applicatively with this syntax, but i doubt you could have invented it.

There are no comments on this comment yet.