Help

Juan M. Duran juan@inf.ufpr.br
Mon, 25 Feb 2002 12:14:09 -0300 (BRT)


I thing that wont works, look:
 contents :: IO [Char]

 parser :: Integral a => [Char] -> [a]

 control :: [Float] -> [[Float]]

 The two problems are:
       1) The input of parser. Doesnt match with the type of input
       2) The input of control (or the output of parser). Doesn match
 with the type of the next function.

On Mon, 25 Feb 2002, Rijk J. C. van Haaften wrote:

> You probably want to do something like this:
> 
> main =
>      do {
>          contents <- input "twoboxes.dat"
>          return (control (parser contents))
>      }
> 
> At 11:53 25-02-02 -0300, Juan M. Duran wrote:
> >Hi, I'm writting a small parser in Haskell and, when it is all done, I get
> >the following problem: Type Binding.
> >The thing is, I have 3 main functions:
> >1) Read the file, its type is: [Char] ->IO [Char] (see InputOutput.hs)
> >2) Parse a string (using words and readDec), its type is: Integral a =>
> >[Char] -> [a] (see Parse.hs)
> >3) Parse a list of integer, its type is: [Float] -> [[Float]]
> >(Functions.hs)
> >
> >Now the problem is that I cannot run the first function, then use its
> >results as an input of the second function and, finally, its results as
> >the input of the third function.
> >
> >How can I fix this without modifing all my functions because they,
> >independly, works fine.
> >
> >Juan
> 
>