Perhaps something like
for :: Int -> Int -> (Int -> IO ()) -> IO ()
for begin end f = sequence_ [ f i | i <- [begin..end] ]
*Main> for 1 10 print
1
2
3
4
5
6
7
8
9
10
On 25/12/2005, at 9:35 PM, Branimir Maksimovic wrote:
From: Lennart Augustsson <[EMAIL PROTECTED]>
To: Branimir Maksimovi
Thanks Sebastian, I guess I was ignoring the type of Succ like you
said. Glad to have passed that mental barrier!
On 23/12/2005, at 12:14 PM, Sebastian Sylvan wrote:
On 12/23/05, Matt Collins <[EMAIL PROTECTED]> wrote:
Hi everyone,
I'm relatively new to Haskell and was a bit
Hi everyone,
I'm relatively new to Haskell and was a bit troubled by the problem
of assigning a type to infinite structures. To give a clear example,
suppose we have
data Nat = Zero | Succ Nat
omega = Succ omega
What type then does omega have? According to GHCi, omega :: Nat. But
surely