Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Haskell Types

Name: Anonymous 2008-02-17 6:34

So I've been learning Haskell for some time, I get some basic and intermediate stuff, some monad basics, but could anyone recommend a good tutorial that explains type system better than YAHT?

Name: Anonymous 2008-02-17 17:46

>>25
module Main where

import IO

getNums = do
    putStrLn "give numbers"
    line <- getLine
    let number = read line
    if number == 0
        then return []
        else do
            rest <- getNums
            return (number : rest)

fact n = product [1 .. n]

getFacts = do
    nums <- getNums
    return (map fact nums)


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List