Read file problems

2003-09-15 Thread Frederic BELLOC
HI,
I have a recurrent probleme with function readFile and Monad :
it is that i try to get a line, transform it  and stock it in a list
and what i want is that function return me the list.
But hugs say me that in

readFile my_file = \s - map cons_line (lines s)
readFile is a IO String type but is used here as [[Char]] type...
and i don't know what to do... 

Ghc say me that is the lambda abstraction that fails with 
map cons_line (lines s) , he couldn't match IO against [] !

Help me please, i understand well (i hope) how Monad work but here i don't see
a solution.

Sorry for my poor english but i'm already a student.

Thanks for all.
-- 
C, socks and sun ;-)
and haskell bugs :-(

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Tuples or Record

2003-08-18 Thread Frederic BELLOC
Hello,
When I have started my project, I use a Tuples but i would know if it
is possible to create a record such C or Ocaml provide. I mean creating
a structure  where variables are accessible by a '.' or something
like that.
-- 
BELLOC Frederic
EPITA 2005 STUDENT
C, socks and sun !

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe