Re: [Haskell-cafe] Haskell Weekly News: Issue 85 - September 13, 2008

2008-09-14 Thread Brandon S. Allbery KF8NH
On 2008 Sep 14, at 1:24, Daryoush Mehrtash wrote: What I am trying to figure out is that say on the code for the IRC bot that is show here http://www.haskell.org/haskellwiki/Roll_your_own_IRC_bot/Source What would theorem proofs do for me? Assurance of correct operation; for example, a

[Haskell-cafe] static linking failure -- can't find crt0

2008-09-14 Thread Jason Dusek
I'm building a really static executable on OS X with options `-optl-static -static` and, while the libraries seem to link fine, the executable itself does not -- it can't find the C runtime. This is actually by design -- Apple does not support static binaries. There is a work around

[Haskell-cafe] Hugs on the iphone

2008-09-14 Thread Alberto R. Galdo
Hi, is there any chance of having hugs compile for the iPhone? Cross-compiling? Compiling directly on the iPhone? Greets, Alberto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Haskell Weekly News: Issue 85 - September 13, 2008

2008-09-14 Thread Rafael Almeida
On Sun, Sep 14, 2008 at 5:56 AM, Thomas M. DuBuisson [EMAIL PROTECTED] wrote: What would theorem proofs do for me? Imagine if you used SmallCheck to exhastively test the ENTIRE problem space for a given property. Now imagine you used your brain to show the programs correctness before the

Re: [Haskell-cafe] ANN: pandoc 1.0.0.1

2008-09-14 Thread Max Bolingbroke
2008/9/14 John Goerzen [EMAIL PROTECTED]: 2) Variable x defined but not used I most often ignore this when it occurs in a function definition. Sometimes I may have a function that could be written foo _ (x, _) _ = bar (x + 5) But for clarity's sake on what all the unused args are, which

Re: [Haskell-cafe] Haskell Weekly News: Issue 85 - September 13, 2008

2008-09-14 Thread Chaddaï Fouché
2008/9/14 Rafael Almeida [EMAIL PROTECTED]: One thing have always bugged me: how do you prove that you have correctly proven something? I mean, when I write a code I'm formaly stating what I want to happen and bugs happen. If I try to prove some part of the code I write more formal text

Re: [Haskell-cafe] Views

2008-09-14 Thread Johannes Waldmann
I think the crux of the matter was that a monad is too general. Either there is a result or there is not. That's precisely the intended use of a Maybe. Indeed Monad m = is dangerous here because not every Monad has a reasonable definition of fail. But that seems to be a problem in the

Re: [Haskell-cafe] Views

2008-09-14 Thread Stephan Friedrichs
Johannes Waldmann wrote: a) ... to use Maybe b) ... to provide my own Data.Heap.View type leave the choice up to the programmer, and provide a generic interface, accepting any MonadZero (*) instance. cf. Data.Set.maxView AFAIK there has been a vivid discussion about that. I think the

Re: [Haskell-cafe] Re: [Haskell] Heads Up: code.haskell.org is upgrading to darcs 2

2008-09-14 Thread Neil Mitchell
Hi Ignore the previous email message, as soon as I sent the email it started working - I guess it was just code.haskell.org server issues. Thanks Neil On 9/14/08, Neil Mitchell [EMAIL PROTECTED] wrote: Hi I'm currently unable to push to [EMAIL PROTECTED]:/srv/code/hoogle using darcs

Re: [Haskell-cafe] Views

2008-09-14 Thread Stephan Friedrichs
Johannes Waldmann wrote: I think the crux of the matter was that a monad is too general. Either there is a result or there is not. That's precisely the intended use of a Maybe. Indeed Monad m = is dangerous here because not every Monad has a reasonable definition of fail. But that seems

[Haskell-cafe] Re: Hugs on the iphone

2008-09-14 Thread Braden Shepherdson
Alberto R. Galdo wrote: Hi, is there any chance of having hugs compile for the iPhone? Cross-compiling? Compiling directly on the iPhone? Greets, Alberto The iPhone, like most modern mobile devices, is based on the ARM processor, for which there is currently no GHC port. However, jhc

[Haskell-cafe] Re: Hugs on the iphone

2008-09-14 Thread Braden Shepherdson
Braden Shepherdson wrote: Alberto R. Galdo wrote: Hi, is there any chance of having hugs compile for the iPhone? Cross-compiling? Compiling directly on the iPhone? Greets, Alberto The iPhone, like most modern mobile devices, is based on the ARM processor, for which there is currently no

Re: [Haskell-cafe] Re: [Haskell] Heads Up: code.haskell.org is upgrading to darcs 2

2008-09-14 Thread Duncan Coutts
On Sun, 2008-09-14 at 14:41 +0100, Neil Mitchell wrote: Hi Ignore the previous email message, as soon as I sent the email it started working - I guess it was just code.haskell.org server issues. Yes it was unavailable for a short time yesterday. It got rebooted by the hosting company, we're

Re: [Haskell-cafe] Haskell Weekly News: Issue 85 - September 13, 2008

2008-09-14 Thread Dan Doel
On Sunday 14 September 2008 6:59:06 am Rafael Almeida wrote: One thing have always bugged me: how do you prove that you have correctly proven something? I mean, when I write a code I'm formaly stating what I want to happen and bugs happen. If I try to prove some part of the code I write more

[Haskell-cafe] system in forkIO

2008-09-14 Thread Marco Túlio Gontijo e Silva
Hello. import System.Cmd import GHC.Conc main :: IO () main = forkIO ( do putStrLn fork system ls return ()) getChar return () When I run this code, I get fork and the result of ls only after I press a key. Does getChar blocks the other

Re: [Haskell-cafe] system in forkIO

2008-09-14 Thread Andrea Rossato
On Sun, Sep 14, 2008 at 02:24:23PM -0300, Marco Túlio Gontijo e Silva wrote: and the result of ls only after I press a key. Does getChar blocks the other threads? yes, but you can use forkOS from Control.Concurrent and compile with -threaded. See the relevant documentation for the details.

Re: [Haskell-cafe] system in forkIO

2008-09-14 Thread Judah Jacobson
On Sun, Sep 14, 2008 at 10:24 AM, Marco Túlio Gontijo e Silva [EMAIL PROTECTED] wrote: When I run this code, I get fork and the result of ls only after I press a key. Does getChar blocks the other threads? I think this behavior is caused by (or at least related to) the following GHC bug:

Re: [Haskell-cafe] message passing style in Monad

2008-09-14 Thread Simon Richard Clarkstone
jinjing wrote: I found that as I can do xs.map(+1).sort by redefine . to be a . f = f a infixl 9 . This looks rather like ($), but backwards. I believe the F# name for this operator is (|), which is also a legal name for it in Haskell. Odd, since (|) alone isn't legal. Calling it

[Haskell-cafe] Semantic Domain, Function, and denotational model.....

2008-09-14 Thread Daryoush Mehrtash
I have been told that for a Haskell/Functional programmer the process of design starts with defining Semantic Domain, Function, and denotational model of the problem. I have done some googling on the topic but haven't found a good reference on it.I would appreciate any good references on the

[Haskell-cafe] Re: Semantic Domain, Function, and denotational model.....

2008-09-14 Thread Jean-Philippe Bernardy
Daryoush Mehrtash dmehrtash at gmail.com writes: I have been told that for a Haskell/Functional programmer the process of design starts with defining Semantic Domain, Function, and denotational model of the problem. I have done some googling on the topic but haven't found a good reference

Re: [Haskell-cafe] Views

2008-09-14 Thread Iavor Diatchki
Hi, On Sun, Sep 14, 2008 at 7:01 AM, Stephan Friedrichs [EMAIL PROTECTED] wrote: I agree that the MonadZero class with a useful 'zero' :: m a would be the right abstraction for views. But MonadZero is not part of base, mtl or any other common package, or am I missing something? Changing this

Re: [Haskell-cafe] system in forkIO

2008-09-14 Thread Marco Túlio Gontijo e Silva
Em Dom, 2008-09-14 às 11:08 -0700, Judah Jacobson escreveu: On Sun, Sep 14, 2008 at 10:24 AM, Marco Túlio Gontijo e Silva [EMAIL PROTECTED] wrote: When I run this code, I get fork and the result of ls only after I press a key. Does getChar blocks the other threads? I think

Re: [Haskell-cafe] system in forkIO

2008-09-14 Thread Jules Bean
Andrea Rossato wrote: On Sun, Sep 14, 2008 at 02:24:23PM -0300, Marco Túlio Gontijo e Silva wrote: and the result of ls only after I press a key. Does getChar blocks the other threads? yes, but you can use forkOS from Control.Concurrent and compile with -threaded. See the relevant

Re: [Haskell-cafe] message passing style in Monad

2008-09-14 Thread Ketil Malde
Simon Richard Clarkstone [EMAIL PROTECTED] writes: I can also do readFile readme.markdown . lines . length by making (.) = flip fmap ? -k -- If I haven't seen further, it is by standing in the footprints of giants ___ Haskell-Cafe mailing

Re: [Haskell-cafe] system in forkIO

2008-09-14 Thread Marco Túlio Gontijo e Silva
Em Dom, 2008-09-14 às 16:07 -0300, Marco Túlio Gontijo e Silva escreveu: Thanks, I got it to work running threadWaitRead stdInput before getChar. Now I've got another problem: import Control.Concurrent import System.IO import System.Process main :: IO () main = do process -

Re: [Haskell-cafe] system in forkIO

2008-09-14 Thread Don Stewart
marcot: Em Dom, 2008-09-14 às 16:07 -0300, Marco Túlio Gontijo e Silva escreveu: Thanks, I got it to work running threadWaitRead stdInput before getChar. Now I've got another problem: import Control.Concurrent import System.IO import System.Process main :: IO () main

Re: [Haskell-cafe] ask

2008-09-14 Thread Jeremy Shaw
Hello, If we look at these two examples, it appears that the results are reversed: Prelude let n o = (-1 `o` 1) in n (-) 0 Prelude let n o = (-1 `o` 1) in n (+) -2 Prelude we expect (-1 - 1) = -2 and (-1 + 1) = 0, but we get the opposite. Due to operator precedence, the equations are being

Re: [Haskell-cafe] ask

2008-09-14 Thread Daniel Fischer
Am Montag, 15. September 2008 02:24 schrieb Cetin Sert: Hi why do I get? Buffering. For compiled programmes, stdin and stdout are line-buffered by default, so the output doesn't appear until the program finishes. Either put hSetBuffering stdout NoBuffering at the top of main or, better IMO,

Re: [Haskell-cafe] ask

2008-09-14 Thread Brandon S. Allbery KF8NH
On 2008 Sep 14, at 20:47, Brandon S. Allbery KF8NH wrote: On 2008 Sep 14, at 20:24, Cetin Sert wrote: Hi why do I get? [EMAIL PROTECTED]:~/lab/exp/1 ./eq 23 23 3 a = b = c = n1-0.8457820374040622n2-0.1542179625959377 As is typical for Unix, filehandles including standard input and standard

Re: [Haskell-cafe] Hugs on the iphone

2008-09-14 Thread Miguel Mitrofanov
As pie. Just downloaded the source and compiled it on iPhone itself (no cross-compiling). On 15 Sep 2008, at 09:25, Don Stewart wrote: Very nice. Easy? miguelimo38: Did that. http://migmit.vox.com/library/photo/6a00e398c5c26f000500fa9696d8c40002.html On 14 Sep 2008, at 14:17, Alberto R.

Re: [Haskell-cafe] Hugs on the iphone

2008-09-14 Thread Don Stewart
Very nice. Easy? miguelimo38: Did that. http://migmit.vox.com/library/photo/6a00e398c5c26f000500fa9696d8c40002.html On 14 Sep 2008, at 14:17, Alberto R. Galdo wrote: Hi, is there any chance of having hugs compile for the iPhone? Cross-compiling? Compiling directly on the iPhone?

Re: [Haskell-cafe] Hugs on the iphone

2008-09-14 Thread Miguel Mitrofanov
Did that. http://migmit.vox.com/library/photo/6a00e398c5c26f000500fa9696d8c40002.html On 14 Sep 2008, at 14:17, Alberto R. Galdo wrote: Hi, is there any chance of having hugs compile for the iPhone? Cross-compiling? Compiling directly on the iPhone? Greets, Alberto

[Haskell-cafe] ask

2008-09-14 Thread Cetin Sert
Hi why do I get? [EMAIL PROTECTED]:~/lab/exp/1 ./eq 23 23 3 a = b = c = n1-0.8457820374040622n2-0.1542179625959377 when I run import System.IO main :: IO () main = do a ← ask a b ← ask b c ← ask c eval a b c ask v = do putStr (v ++ = ) readLn eval a b c = do case delta 0 of

Re: [Haskell-cafe] system in forkIO

2008-09-14 Thread Marco Túlio Gontijo e Silva
Em Dom, 2008-09-14 às 14:52 -0700, Don Stewart escreveu: marcot: Em Dom, 2008-09-14 às 16:07 -0300, Marco Túlio Gontijo e Silva escreveu: Thanks, I got it to work running threadWaitRead stdInput before getChar. Now I've got another problem: import Control.Concurrent

Re: [Haskell-cafe] ask

2008-09-14 Thread Brandon S. Allbery KF8NH
On 2008 Sep 14, at 20:24, Cetin Sert wrote: Hi why do I get? [EMAIL PROTECTED]:~/lab/exp/1 ./eq 23 23 3 a = b = c = n1-0.8457820374040622n2-0.1542179625959377 As is typical for Unix, filehandles including standard input and standard output are line buffered. See hSetBuffering (

Re: [Haskell-cafe] ask

2008-09-14 Thread Richard A. O'Keefe
On 15 Sep 2008, at 12:51 pm, Daniel Fischer wrote: Am Montag, 15. September 2008 02:24 schrieb Cetin Sert: Hi why do I get? Buffering. For compiled programmes, stdin and stdout are line- buffered by default, so the output doesn't appear until the program finishes. Either put hSetBuffering

Re: [Haskell-cafe] Hugs on the iphone

2008-09-14 Thread Alberto R. Galdo
Cool! That's such a proof that it can be done... I had lots of problems trying to cross compile hugs from my mac to arm architecture ( seems that hugs codebase is not capable of cross compiling ) And when compiling directly on the iPhone, first there where problems with code signing,