News for hackers. Stuff that matters.
Re:Show HN: Tic Tac Toe Implemented in Elm by kqr on Sunday October 15, 2017 @06:15AM (#15476563)
Not sure how you reached that number. The Elm code, with blank lines removed, is less than 320 lines. Given the incredibly spacious style its written in, I'd definitely say 300 rather than 400.

But sure, that's still a lot. Part of it is that Elm lacks the proper generics support (which you can observe in the function names) and part is that the archotecture chosen by the creator may not be optimal in terms of maintainability. For example,

    type Cell = NotOwned CellLocation | OwnedBy CellLocation Player
and I think, why not

    type Cell = Cell Location (Maybe Player)
? Its isomorphic (carries the same information) and it removes the need for the complicated getters.
Re:Show HN: Tic Tac Toe Implemented in Elm by vishaltelangre on Monday October 16, 2017 @02:06AM (#15481191)
Yes, there are lot places I think I can optimize it. It is an initial implementation to get something working. Thanks.