|
![](/i/fill.gif) |
On 02/09/2011 04:36 PM, Invisible wrote:
> Hypothesis: The Haskell language isn't hard. Typical Haskell *programs*
> are hard.
Let's test that hypothesis. Consider the following example:
module Main where
import System.IO
import System.Random
main = do
x <- randomRIO (1, 100)
main_loop x
main_loop x = do
putStr "Guess: "
hFlush stdout
l <- getLine
let g = read l
if g == x
then putStrLn "Correct."
else do
if g < x
then putStrLn "Too low."
else putStrLn "Too high."
main_loop x
This is written in Haskell. However, I would expect that anybody
familiar with computer programming should be able to figure out what
this does, without knowing anything at all about Haskell. I mean, you
couldn't /write/ this code, but you can /read/ it and figure out what it
does. Which would seem to strongly contradict "Haskell is incomprehensible".
...or maybe I'm just delusional from having spent too long with Haskell?
Maybe it only looks readable to my eyes. What do we say, people?
Post a reply to this message
|
![](/i/fill.gif) |