Re: [Haskell-cafe] enforcing strictness on arbitrary subexpressions

2006-02-17 Thread Matthias Fischmann
Thanks Udo, that helped a lot. I added the link to haskell.org. I couldn't find a proper place to put it, so I added a page 'By topic' (still quite empty) linked from the main page. (I hope that wasn't against any rules I missed; if anybody objects please feel free to remove it.) cheers,

[Haskell-cafe] descriptive symbols, was: monad combinator

2006-02-17 Thread Christian Maeder
Tomasz Zielonka wrote: On Thu, Feb 16, 2006 at 04:36:06PM +0100, Christian Maeder wrote: Udo Stenzel wrote: (*) :: Monad m = m a - m b - m a m * n = do a - m ; n ; return a Right, that one is really useful. I named it (), though, conforming to (=) versus (=). But = first executes the

[Haskell-cafe] HaXml: ampersand in attribute value

2006-02-17 Thread Koen . Roelandt
HaXml seems to choke on finding an ampersand in an attribute value. Is this normal? Is there any workaround? Cheers, Koen. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Code completion? (IDE)?

2006-02-17 Thread Marc Weber
On Thu, Feb 16, 2006 at 09:50:51AM -0300, Thiago Arrais wrote: On 2/16/06, Thiago Arrais [EMAIL PROTECTED] wrote: Just take a look at the latest integration build that you are able to find at http://eclipsefp.sourceforge.net/download There is also a screenshot at

Re: [Haskell-cafe] Code completion? (IDE)?

2006-02-17 Thread Ketil Malde
Marc Weber [EMAIL PROTECTED] writes: I tried downloading, eclipse and the latest EcplipseFP zip file. I couldn't use the standard installer (Help- Add Features ..) because it didn't find anything.. Strange, that worked for me. From my quick look, Eclipse looks like a workable candidate.

Re: [Haskell-cafe] HaXml: ampersand in attribute value

2006-02-17 Thread Malcolm Wallace
[EMAIL PROTECTED] wrote: HaXml seems to choke on finding an ampersand in an attribute value. Is this normal? Is there any workaround? Yes, it is expected. An ampersand indicates the start of a reference, e.g. lt; or #20; If there is no semicolon to indicate the end of the reference, then

[Haskell-cafe] Re: Associated Type Synonyms question

2006-02-17 Thread Stefan Wehr
Martin Sulzmann [EMAIL PROTECTED] wrote:: Stefan Wehr writes: [...] Manuel (Chakravarty) and I agree that it should be possible to constrain associated type synonyms in the context of class definitions. Your example shows that this feature is actually needed. I will integrate it into

[Haskell-cafe] (Newbie Question) How to get the value of an IO String Monad?

2006-02-17 Thread Peter
Hello, For the purpose of familiarizing myself with Haskell, and also because I love Haskell :), I am trying to re-make a script that I made in Python that sends a request to a server and extracts the list of email addresses from a Mailman web-page by using an XML Parser on the page's HTML that

[Haskell-cafe] haskell question

2006-02-17 Thread IBRAHIM MOSHAYA
please can you help me with this function: Significant Figures I need to write a function to return a given number (1st argument) to a given number of significant figures (2nd argument). The function should be called sigFig and have a type signature of the form: sigFig :: (???) = a - Int - a

Re: [Haskell-cafe] (Newbie Question) How to get the value of an IO String Monad?

2006-02-17 Thread Marc Weber
You can access IO values only from within do blocks (see any tutorial, previous posts or google). It looks like this then: do= myvalue - functionwhichreturnsIOValue dosomethingwith myvalue Due to monads you don't have to leave the IO monad this way. Oh. Have to go now. do is translated into

Re: [Haskell-cafe] HaXml: ampersand in attribute value

2006-02-17 Thread Lennart Augustsson
But speaking of HaXml bugs, I'm pretty sure HaXml doesn't handle % correctly. It seem to treat % specially everywhere, but I think it is only special inside DTDs. I have many XML files produced by other tools that the HaXml parser fails to process because of this. -- Lennart Malcolm

Re: [Haskell-cafe] (Newbie Question) How to get the value of an IO String Monad?

2006-02-17 Thread Ketil Malde
Peter [EMAIL PROTECTED] writes: So, How am I supposed to get the value of an IO Monad, such as IO String, without returning an IO Monad? Short answer: you don't. IO is a one way street. Build your application top down in the IO monad (starting with 'main'), and bottom up with pure code,

Re: [Haskell-cafe] haskell question

2006-02-17 Thread Ketil Malde
IBRAHIM MOSHAYA [EMAIL PROTECTED] writes: I need to write a function to return a given number Homework assignment? Perhaps if you get stuck, you can post your best current effort, and people will be able to nudge you in the right direction? -k -- If I haven't seen further, it is by standing

Re: [Haskell-cafe] (Newbie Question) How to get the value of an IO String Monad?

2006-02-17 Thread Lemmih
On 2/17/06, Peter [EMAIL PROTECTED] wrote: Hello, For the purpose of familiarizing myself with Haskell, and also because I love Haskell :), I am trying to re-make a script that I made in Python that sends a request to a server and extracts the list of email addresses from a Mailman web-page

Re: [Haskell-cafe] library sort

2006-02-17 Thread Radu Grigore
On 2/16/06, Jared Updike [EMAIL PROTECTED] wrote: If you need an easier way to search the Haskell APIs, use Hoogle: Hoogle is very nice. Thanks to everyone who answered my question about finding a sort library function. -- regards, radu http://rgrig.blogspot.com/

Re: [Haskell-cafe] (Newbie Question) How to get the value of an IO String Monad?

2006-02-17 Thread Daniel Fischer
Hi, Am Freitag, 17. Februar 2006 14:42 schrieb Peter: Hello, For the purpose of familiarizing myself with Haskell, and also because I love Haskell :), very good! I am trying to re-make a script that I made in Python that sends a request to a server and extracts the list of email addresses

Re: [Haskell-cafe] Re: Associated Type Synonyms question

2006-02-17 Thread Claus Reinke
Something more controversial. Why ATS at all? Why not encode them via FDs? Funny you should say that, just when I've been thinking about the same thing. That doesn't mean that ATS aren't a nice way to describe some special cases of FDs, but my feeling is that if ATS can't be encoded in FDs,

Re: [Haskell-cafe] Re: Associated Type Synonyms question

2006-02-17 Thread Ross Paterson
On Fri, Feb 17, 2006 at 01:26:18PM +, Stefan Wehr wrote: Martin Sulzmann [EMAIL PROTECTED] wrote:: By possible you mean this extension won't break any of the existing ATS inference results? Yes, although we didn't go through all the proofs. You have to be very careful otherwise

[Haskell-cafe] Re: HaXml: ampersand in attribute value

2006-02-17 Thread Koen . Roelandt
But speaking of HaXml bugs, I'm pretty sure HaXml doesn't handle % correctly. It seem to treat % specially everywhere, but I think it is only special inside DTDs. I have many XML files produced by other tools that the HaXml parser fails to process because of this. I had a similar problem

Re: [Haskell-cafe] (Newbie Question) How to get the value of an IO String Monad?

2006-02-17 Thread Udo Stenzel
Peter wrote: So, How am I supposed to get the value of an IO Monad, such as IO String, without returning an IO Monad? You read correctly, this is impossible. You already got some valid answers, and here's another variant that preserves most of the nice guarded expressions: recv_headers' ::

Re: [Haskell-cafe] HaXml: ampersand in attribute value

2006-02-17 Thread Malcolm Wallace
Lennart Augustsson wrote: But speaking of HaXml bugs, I'm pretty sure HaXml doesn't handle % correctly. It seem to treat % specially everywhere, but I think it is only special inside DTDs. I have many XML files produced by other tools that the HaXml parser fails to process because of this.

Re: [Haskell-cafe] Badly designed Parsec combinators?

2006-02-17 Thread Jan-Willem Maessen
On Feb 16, 2006, at 7:32 PM, John Meacham wrote: ... Again that doesn't compile, because when requires a ()-returning monad as its second parameter, but the string parser returns String. Same thing with if-then-else, when used to switch IO actions and such: the IO actions must fully

[Haskell-cafe] Infinite loop?

2006-02-17 Thread rgo
Hi all, my program probably goes into infinite loop... But i cannot understand where and why. code: import System.Directory data MyFile = MyDir { dir_name :: String, dir_files :: [MyFile] } | MyFile { file_name :: String }

Re: [Haskell-cafe] Infinite loop?

2006-02-17 Thread Jon Fairbairn
On 2006-02-17 at 20:12GMT rgo wrote: Hi all, my program probably goes into infinite loop... But i cannot understand where and why. getDirectoryContents will include . and .., so if you follow those, you're bound to loop. -- Jón Fairbairn Jon.Fairbairn at

Re: [Haskell-cafe] Infinite loop?

2006-02-17 Thread Jared Updike
Yep. change one line to: entry - if isdir name /= . name /= .. and it does in fact work. Jared. On 2/17/06, Jon Fairbairn [EMAIL PROTECTED] wrote: On 2006-02-17 at 20:12GMT rgo wrote: Hi all, my program probably goes into infinite loop... But i cannot understand where and why.

Re: [Haskell-cafe] Infinite loop?

2006-02-17 Thread Jon Fairbairn
On 2006-02-17 at 09:22PST Jared Updike wrote: Yep. change one line to: entry - if isdir name /= . name /= .. and it does in fact work. Only if no-one has been tricky with symbolic links. -- Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk

[Haskell-cafe] Problems instancing a class

2006-02-17 Thread Juan Carlos Arevalo Baeza
So, consider this code: import Data.HashTable as HT class MyClass a where htLookup :: a - String - IO String type Context = HT.HashTable String String instance MyClass Context where htLookup h var = do result - HT.lookup h var case result of Nothing -

Re: [Haskell-cafe] Problems instancing a class

2006-02-17 Thread Jared Updike
type introduce a type synonym, and Haskell98 forbids these in instances, so GHC complains. GHC also lifts this restriction when invoked with -fglasgow-exts . http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#type-synonyms Flexible Instances will probably be added

Re: [Haskell-cafe] Problems instancing a class

2006-02-17 Thread Juan Carlos Arevalo Baeza
Gerrit van den Geest wrote: Mark Mark Jones has (some time ago) also written a very detailed e-mail about this topic: http://www.haskell.org/pipermail/haskell/2000-October/006128.html I really don't understand anything spoken about in this message. I guess I need it translated into plain

Re: [Haskell-cafe] Infinite loop?

2006-02-17 Thread rgo
On Fri, 17 Feb 2006 17:19:53 + Jon Fairbairn [EMAIL PROTECTED] wrote: On 2006-02-17 at 20:12GMT rgo wrote: Hi all, my program probably goes into infinite loop... But i cannot understand where and why. getDirectoryContents will include . and .., so if you follow those, you're bound

Re: [Haskell-cafe] Unexpected results with simple IO

2006-02-17 Thread Cale Gibbard
That doesn't happen for me at all, it works just fine. Maybe it's something wrong with your terminal? You could possibly try playing with the buffering settings on stdout, using hSetBuffering in System.IO. - Cale On 17/02/06, Maurício [EMAIL PROTECTED] wrote: Dear Haskell users, I have

Re: [Haskell-cafe] Problems instancing a class

2006-02-17 Thread Benjamin Franksen
On Friday 17 February 2006 21:03, Juan Carlos Arevalo Baeza wrote: What really got me is that if I don't use a type synonym: instance MyClass (HT.HashTable String String) where htLookup h var = do result - HT.lookup h var case result of Nothing -

[Haskell-cafe] Re: Unexpected results with simple IO

2006-02-17 Thread Maurício
You're right... I was running the example in rxvt, in cygwin. Now I tried in Windows command shell and it works. Thanks, Maurício Cale Gibbard wrote: That doesn't happen for me at all, it works just fine. Maybe it's something wrong with your terminal? You could possibly try playing with

Re: [Haskell-cafe] (Newbie Question) How to get the value of an IO String Monad?

2006-02-17 Thread Cale Gibbard
Hi, Apart from the other posts, you might also want to read http://www.haskell.org/hawiki/IntroductionToIO which is a quick intro to the way IO is handled in Haskell and http://www.haskell.org/hawiki/UsingIo which covers similar ground, but which also goes into a number of other common questions.

[Haskell-cafe] Re: (Newbie Question) How to get the value of an IO String Monad

2006-02-17 Thread Peter
Hello All, Thanks Cale, Udo, Daniel, Lemmih, Ketil, and Marc for your very helpful posts, and Haskell resources. Every post really helped a lot. Thanks for all the help, Peter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org