News for hackers. Stuff that matters.
Re:Show HN: Tic Tac Toe Implemented in Elm by tome on Sunday October 15, 2017 @12:13PM (#15477746)
It's full of stuff like

    flipPlayer : Player -> Player
    flipPlayer currentPlayer =
        case currentPlayer of
            X ->
                O
    
            O ->
                X
which is 8 lines where idiomatic Haskell would take 3.

    flipPlayer : Player -> Player
    flipPlayer X = O
    flipPlayer O = X
I don't know if Elm encourages or mandates that verbose style but it's not some sort of "FP" requirement.
Re:Show HN: Tic Tac Toe Implemented in Elm by vishaltelangre on Monday October 16, 2017 @10:23AM (#15483365)
Compiler throws following error if I do it.

  Naming multiple top-level values `flipPlayer` makes things ambiguous. When you
  say `flipPlayer` which one do you want?

  128| flipPlayer O =