
Hello! Thanks for your answer!
Perhaps try:
do ... ciwd <- sequence classifiedImagesWithData let allImages = (getImages ciwd) ...
as it seems like you're trying to gave getImages act on a value of type [IO (ClassifiedImage, Image)]. Applying sequence to classifiedImagesWithData will turn it into an IO [(ClassifiedImage, Image)] by doing the natural thing, from which you can pull out the list to apply getImages to.
I've tried that and wrote <code-snippet> do... let classifiedImagesWithData = ((return trainingSet) >>= readClassifiedImages) ciwd <- (sequence classifiedImagesWithData) let allImages = (getImages ciwd) </code-snippet> Now, I get the error <error> Compiling ExperimentalYaleDb ( ExperimentalYaleFaceDb.hs, interpreted ) ExperimentalYaleFaceDb.hs:41: Couldn't match `[]' against `IO' Expected type: [[a]] Inferred type: [IO (ClassifiedImage, Image)] In the first argument of `sequence', namely `classifiedImagesWithData' In a 'do' expression: ciwd <- (sequence classifiedImagesWithData) Failed, modules loaded: TestLik, Lik, HUnit, HUnitText, HUnitBase, HUnitLang. </error> at line ciwd <- (sequence classifiedImagesWithData) Are there any other options? Thanks in advance Dmitri Pissarenko PS: Maybe the error is rooted in code parts other than those given here. In the attachment there is the code of the main program (ExperimentalYaleFaceDb.hs) and the function definitions (Lik.hs). -- Dmitri Pissarenko Software Engineer http://dapissarenko.com