Re: how to convert IO String to string---- still have questions

2002-11-24 Thread Lu Mudong
Thanks a lot for you guys' help. I am very new to haskell and tried some methods you guys advised, doesn't seem to work, i think i didn't do it properly, here's my code and result, hope you can point out what's wrong. thanks! my code: myReadFile :: IO String myReadFile = readFile "d:/hugs98/in

Re: how to convert IO String to string---- still have questions

2002-11-24 Thread Nick Name
On Sun, 24 Nov 2002 09:05:17 -0900 "Lu Mudong" <[EMAIL PROTECTED]> wrote: > Thanks a lot for you guys' help. > > I am very new to haskell and tried some methods you guys advised, > doesn't seem to work, i think i didn't do it properly, here's my code > and result, hope you can point out what's wr

Re: how to convert IO String to string---- still have questions

2002-11-24 Thread Wolfgang Jeltsch
Hello, several mails spoke about converting an IO String to a String. I have to point out that such a conversion is not what happens when you use monadic I/O. In fact, such a conversion is just not possible in Haskell 98. Since Haskell is a pure language, evaluating a String expression mustn't

Re: how to convert IO String to string

2002-11-24 Thread Glynn Clements
Lu Mudong wrote: > hi, all, I'm having problem convert IO String to string, That's because you can't convert IO String to String. > I read a file, and it's an IO String, No. Calling readFile doesn't read the file, and the value which readFile returns isn't the result of reading the file. The

Re: how to convert IO String to string---- still have questions

2002-11-24 Thread Glynn Clements
Nick Name wrote: > This approach is called "monads" and is needed because haskell is a lazy > language, so order of evaluation is unspecified, while input/output > usually needs a precise order of evaluation. It is needed because Haskell is a functional language, where functions are referentiall

Re: how to convert IO String to string---- still have questions

2002-11-24 Thread Nick Name
On Sun, 24 Nov 2002 20:42:31 + Glynn Clements <[EMAIL PROTECTED]> wrote: > Even if Haskell were strict, you still wouldn't be able to treat I/O > operations as functions without discarding referential transparency. Yes, but if haskell were strict, it wouldn't really need referential transpar

CFP: GMAG'2003

2002-11-24 Thread Dr. M. Sarfraz
= International Conference on Geometric Modeling & Graphics (Previously, Computer Aided Geometric Design Symposium) (GMAG 2003) in co-operation with IEEE Computer Society JULY 16-18, 2003 London, UK. = Aims and Scope: === Computer-Aided (CA) tec

Re: how to convert IO String to string (Simple answer)

2002-11-24 Thread David Sankel
--- Lu Mudong <[EMAIL PROTECTED]> wrote: > Thanks a lot for you guys' help. > > I am very new to haskell and tried some methods you > guys advised, doesn't > seem to work, i think i didn't do it properly, > here's my code and result, > hope you can point out what's wrong. thanks! > Lots of theo

Re: diff in Haskell: clarification

2002-11-24 Thread Francis Girard
You caught my attention. It would be nice if you write your own version from scratch to make all of us profit of this. Thank you. Francis Girard Le Conquet France Le 22 Novembre 2002 16:03, George Russell a écrit : > > I think in fact I'm going to give up on stealing other people's code and >

Best recursion choice for "penultimax"

2002-11-24 Thread Dr Mark H Phillips
Hi, I have just implemented the function "penultimax" which takes a list of positive integers and produces the "penultimate maximum", that is, the next biggest integer in the list after the maximum. Eg: penultimax [15,7,3,11,5] = 11 One implementation is: penultimax :: [Int] -> Int penultimax

RE: Best recursion choice for "penultimax"

2002-11-24 Thread Mark P Jones
Hi Mark, | I have just implemented the function "penultimax" which takes a list | of positive integers and produces the "penultimate maximum", that is, | the next biggest integer in the list after the maximum. Eg: | | penultimax [15,7,3,11,5] = 11 To your three implementations, let me add anoth