On 11 Feb 2005, at 19:09, Dmitri Pissarenko wrote:
readClassifiedImages :: [ClassifiedImage] -> [IO (ClassifiedImage, Image)]

which is what I want.

However, when in the program I insert the statement

classifiedImagesWithData :: [IO (ClassifiedImage, Image)]

so that it becomes

do ...
classifiedImagesWithData <- (readClassifiedImages trainingSet)
classifiedImagesWithData :: [IO (ClassifiedImage, Image)] -- error line

        Inferred type: IO (ClassifiedImage, Image)


Well, can you explain why you are using do notation at all?
In do notation, the <- form, informally speaking, 'strips off' a Monad. Because the type of readClassifiedImages is a list, then haskell knows you are using the list Monad, so the effect is to work within the list Monad.


It may be you'd profit from reading some of the Monad tutorials out there.

Jules

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to