[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell
Subject:    Re: Standard Haskell and Monad Comprehensions
From:       Daniel Russell <djrussell () kingston ! ac ! uk>
Date:       1997-09-02 18:02:46
Message-ID: 199709021759.NAA03015 () bulldog ! CS ! YALE ! EDU
[Download RAW message or body]

On Tue, 2 Sep 1997, Martin Nor{ick wrote,

> Regarding comprehensions: hugs gives me an error for:
> [a | a <- [10], b <- getLine ]
> and says that getLine must be of type [a], but why? b is not used!

Since [10] is a list, this comprehension is used to generate a list, and
therefore b must take its values from a list. 

b is used since:

[a | a <- [10], b <- "getLine"] = [10,10,10,10,10,10,10]


Dan Russell
Kingston Business School



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic