[Haskell-cafe] OOP vs type classes Re: type gurus, can you please help?

2006-08-16 Thread Bulat Ziganshin
Hello Bulat, Monday, August 14, 2006, 10:37:37 AM, you wrote: i'm started to write article about type classes. can you, type gurus, please check this initial text for correctness in explaining differences between classes and type classes? i continue to develop this text. below is list of

OOP vs type classes Re[2]: [Haskell-cafe] type gurus, can you please help?

2006-08-16 Thread Bulat Ziganshin
Hello Gabriel, Tuesday, August 15, 2006, 10:36:28 PM, you wrote: | Moreover, Haskell type classes supports inheritance. Run-time | polymorphism together with inheritance are often seen as OOP | distinctive points, so during long time i considered type classes as a | form of OOP

[Haskell-cafe] Re: Why does Haskell have the if-then-else syntax?

2006-08-16 Thread Benjamin Franksen
Mike Gunter wrote: I had hoped the History of Haskell paper would answer a question I've pondered for some time: why does Haskell have the if-then-else syntax? The paper doesn't address this. What's the story? For what it's worth, I have been asking myself the same question several times.

Re: OOP vs type classes Re[2]: [Haskell-cafe] type gurus, can you please help?

2006-08-16 Thread Gabriel Dos Reis
Bulat Ziganshin [EMAIL PROTECTED] writes: | Hello Gabriel, | | Tuesday, August 15, 2006, 10:36:28 PM, you wrote: | | | Moreover, Haskell type classes supports inheritance. Run-time | | polymorphism together with inheritance are often seen as OOP | | distinctive points, so during long time i

[Haskell-cafe] iterative algorithms: how to do it in Haskell?

2006-08-16 Thread Tamas K Papp
Hi, I am a newbie learning Haskell. I have used languages with functional features before (R, Scheme) but not purely functional ones without side-effects. Most of the programming I do is numerical (I am an economist). I would like to know how to implement the iterative algorithm below in

Re: [Haskell-cafe] iterative algorithms: how to do it in Haskell?

2006-08-16 Thread Chris Kuklewicz
Tamas K Papp wrote: Hi, I am a newbie learning Haskell. I have used languages with functional features before (R, Scheme) but not purely functional ones without side-effects. Most of the programming I do is numerical (I am an economist). I would like to know how to implement the iterative

[Haskell-cafe] Re: iterative algorithms: how to do it in Haskell?

2006-08-16 Thread Christian Maeder
You might use the Prelude function until: until :: (a - Bool) - (a - a) - a - a until ( 3) (+ 2) 0 = 4 or for your purpose: until (\ a - not (goOn(a, f(a))) f ainit http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v%3Auntil

Re: [Haskell-cafe] The Q Programming Language can do symbolic manipulation -- Haskell?

2006-08-16 Thread Robert Dockins
On Aug 15, 2006, at 11:43 PM, Casey Hawthorne wrote: The Q Programming Language can do symbolic manipulation -- Haskell? The Q Programming Language can do the following: sqr X = X*X ==sqr 5 25 ==sqr (X+1) (X+1)*(X+1) Can Haskell do symbolic manipulation? Well, there's always the

Re: [Haskell-cafe] iterative algorithms: how to do it in Haskell?

2006-08-16 Thread Antti-Juhani Kaijanaho
Tamas K Papp wrote: f is an a-a function, and there is a stopping rule goOn(a,anext) :: a a - Bool which determines when to stop. The algorithm looks like this (in imperative pseudocode): a = ainit while (true) { anext - f(a) if (goOn(a,anext)) a - anext

[Haskell-cafe] Int-[Char] conversion

2006-08-16 Thread Tamas K Papp
Hi, I am working through Hal Daume's tutorial, trying to do the exercises. I can't figure out how to output an integer with putStrLn (or any other way), I think I need an Int - [Char] conversion but couldn't find it. Specifically, in Exercise 3.10, I have the product of numbers in pp, and would

[Haskell-cafe] Re: Int-[Char] conversion

2006-08-16 Thread Jón Fairbairn
Tamas K Papp [EMAIL PROTECTED] writes: Hi, I am working through Hal Daume's tutorial, trying to do the exercises. I can't figure out how to output an integer with putStrLn (or any other way), I think I need an Int - [Char] conversion but couldn't find it. Specifically, in Exercise 3.10, I

Re: [Haskell-cafe] The Q Programming Language can do symbolic manipulation -- Haskell?

2006-08-16 Thread Greg Buchholz
Casey Hawthorne wrote: The Q Programming Language can do the following: sqr X = X*X ==sqr 5 25 ==sqr (X+1) (X+1)*(X+1) Can Haskell do symbolic manipulation? Typeful symbolic differentiation of compiled functions

Re: [Haskell-cafe] Re: Int-[Char] conversion

2006-08-16 Thread Neil Mitchell
Hi, You could try Hoogle URL: http://haskell.org/hoogle/ , though entering Int - [Char] isn't very helpful, A known issue, Hoogle 4 will know about [Char] = String, and will also be tweaked to give show first in this instance. Thanks Neil ___

[Haskell-cafe] Questions on threads and IO

2006-08-16 Thread Creighton Hogg
Hello Haskell'rs, I've been playing with threads and I tried to do a toy example (that used java) from a class. When run, the program should print a prompt and accept commands just like a linux shell. It doesn't have to do anything fancy, just spawn new threads that make system calls when

Re: [Haskell-cafe] Re: Int-[Char] conversion

2006-08-16 Thread ivan gomez rodriguez
Neil Mitchell wrote: Hi, You could try Hoogle URL: http://haskell.org/hoogle/ , though entering Int - [Char] isn't very helpful, A known issue, Hoogle 4 will know about [Char] = String, and will also be tweaked to give show first in this instance. Thanks Neil

Re: [Haskell-cafe] The Q Programming Language can do symbolic manipulation -- Haskell?

2006-08-16 Thread Chris Kuklewicz
Greg Buchholz wrote: Casey Hawthorne wrote: The Q Programming Language can do the following: sqr X = X*X ==sqr 5 25 ==sqr (X+1) (X+1)*(X+1) Can Haskell do symbolic manipulation? Typeful symbolic differentiation of compiled functions

Re: [Haskell-cafe] Questions on threads and IO

2006-08-16 Thread Chris Kuklewicz
It looks like a stdout buffering issue, plus a 'yield' issue. forkIO does not spawn OS level threads (that is forkOS) so adding a yield helps the runtime: import Control.Concurrent import System import System.IO loop = do putStr z - getLine runCommands z yield

Re: [Haskell-cafe] iterative algorithms: how to do it in Haskell?

2006-08-16 Thread ivan gomez rodriguez
Chris Kuklewicz wrote: Tamas K Papp wrote: Hi, I am a newbie learning Haskell. I have used languages with functional features before (R, Scheme) but not purely functional ones without side-effects. Most of the programming I do is numerical (I am an economist). I would like to know how to

Re: [Haskell-cafe] Int-[Char] conversion

2006-08-16 Thread Jared Updike
putStrLn (Product: ++ convertnumbertostring(pp)) Also, there is a predefined function called 'print' where print x = putStr (convertnumbertostring x) i.e. print x = putStr (show x) Jared. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Haskell wiki: most popular pages

2006-08-16 Thread Bulat Ziganshin
Hello haskell-cafe, The http://haskell.org/haskellwiki/Special:Popularpages page lists most popular pages on haskell wiki. I think this list is very useful because it shows us what are the questions about Haskell people most interested and gives us hints what should be improved in first place.

[Haskell-cafe] Samba/FTP bindings

2006-08-16 Thread Ivan Tarasov
Is there some Haskell library which provides Samba bindings and some FTP client library bindings (e.g. ftplib3)?I started writing the bindings for some of the functions myself for my project but it looks like it is a lot of work and probably someone has done it already. -- Best regards,Ivan

[Haskell-cafe] Re: Local functional dependencies: solving show . read and XML generation problems

2006-08-16 Thread Niklas Broberg
Hi Oleg, Thanks a lot for your reply. I see now where my attempt went wrong and why it couldn't work in the first place, the instances will indeed overlap. I'm not completely satisfied with your solution though, but seeing how you did it has lead me to the solution I want. Details below. :-) ]

Re: [Haskell-cafe] Re: Why does Haskell have the if-then-else syntax?

2006-08-16 Thread ajb
G'day all. Quoting Benjamin Franksen [EMAIL PROTECTED]: For what it's worth, I have been asking myself the same question several times. If/then/else syntax could be replaced by a regular (lazy) function without any noticeable loss. I believe that if-then-else cannot be replaced by a regular

Re: [Haskell-cafe] iterative algorithms: how to do it in Haskell?

2006-08-16 Thread Chris Kuklewicz
[EMAIL PROTECTED] wrote: G'day Tamas. Quoting Tamas K Papp [EMAIL PROTECTED]: f is an a-a function, and there is a stopping rule goOn(a,anext) :: a a - Bool which determines when to stop. The algorithm looks like this (in imperative pseudocode): a = ainit while (true) { anext - f(a)

Re: [Haskell-cafe] iterative algorithms: how to do it in Haskell?

2006-08-16 Thread ajb
G'day all. Quoting Chris Kuklewicz [EMAIL PROTECTED]: The compiler may not deforest that list, so creating the list may be a small overhead of this method. And in return, you get: - Code that is smaller than the imperative version, AND - a reusable function, making the next