Re: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-16 Thread minh thu
thanks, brian, udo and the others for your answers [...] I'm led to believe that you just haven't got the hang of the things that just aren't there in C, such as Monads and higher order functions. So you cannot yet see what you would miss in C. (And I guess, you're not feeling at home in C++

Re[2]: [Haskell-cafe] Everything but the lazyness - idea for force/delay lists

2006-06-16 Thread Bulat Ziganshin
Hello Brian, Friday, June 16, 2006, 12:13:27 AM, you wrote: Seriously though, at the moment my aim is to develop an integrated programming environment for a language similar to Haskell, either Haskell itself or a non-lazy version of it, also with some syntactic modifications to make it

Re[2]: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-16 Thread Bulat Ziganshin
Hello Brian, Friday, June 16, 2006, 2:18:24 AM, you wrote: but i consider to move back to c/c++. There is also OCaml and SML, both of which have freely available compilers to generate fast native code (SML has MLton - a whole program optimizing compiler), and which use side effects instead

Re[2]: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-16 Thread Bulat Ziganshin
Hello minh, Friday, June 16, 2006, 12:14:00 AM, you wrote: yes i know about that, but i was talking about randomIO which breaks that view; and i find that quite weird for a 'clean' language. there is also haskell-based language named Clean, look at it too :) * another thing i remember now

Re: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-16 Thread Donald Bruce Stewart
noteed: i want to process 4k pictures (and not just one pixel fater one)... for example. if there is a better solution than array, i'm eager to know it! Try Data.ByteString. 4G can be feasible :) -- Don ___ Haskell-Cafe mailing list

Re: Re[2]: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-16 Thread minh thu
[...] import Data.AltBinary main = putWord32 stdout (1::Int) Bulatmailto:[EMAIL PROTECTED] well, you're right, i've a bit to overemphased the learning difficulty.. but, last time i tried to use your lib, i missed some other libraries (win32 for one ? .. i dont

Re[2]: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-16 Thread Bulat Ziganshin
Hello minh, Friday, June 16, 2006, 10:09:47 AM, you wrote: it's not ok (i always think to the array exemple) : it works well for Thu, haskell/ghc is definitely not for fast execution -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re: [Haskell-cafe] Fibonacci numbers generator in Haskell

2006-06-16 Thread ajb
G'day all. Quoting Mathew Mills [EMAIL PROTECTED]: How about the closed form ;) -- fib x returns the x'th number in the fib sequence fib :: Integer - Integer fib x = let phi = ( 1 + sqrt 5 ) / 2 in truncate( ( 1 / sqrt 5 ) * ( phi ^ x - phi' ^ x ) ) Seems pretty quick to

Re: Re[2]: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-16 Thread minh thu
Thu, haskell/ghc is definitely not for fast execution really, i was not seeking time performance. i try to have a nice to read kind of prototype. but the fact that the program doesn't work with quite small test (but already too big for it) is a problem. Best regards, Bulat

Re: [Haskell-cafe] Rotating matrices

2006-06-16 Thread David House
On 15/06/06, Stefan Holdermans [EMAIL PROTECTED] wrote: transpose = foldr (zipWith (:)) (repeat []) While one-liners like this are very pretty, it's worth thinking about how they work: 1. (:) takes an element and a list and prepends that element to the list. 2. zipWith (:) takes a list of

Re[4]: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-16 Thread Bulat Ziganshin
Hello minh, Friday, June 16, 2006, 10:20:24 AM, you wrote: well, you're right, i've a bit to overemphased the learning difficulty.. but, last time i tried to use your lib, i missed some other libraries (win32 for one ? .. i dont remember). if it was with Streams 0.1e, just remove win32 from

Re: [Haskell-cafe] Fibonacci numbers generator in Haskell

2006-06-16 Thread Ronny Wichers Schreur
Spencer Janssen writes (in the Haskell Cafe): Here's some code I wrote a while back for computing the nth Fibonacci number. It has O(log n) time complexity [..] The nth Fibonacci number has O(n) digits. Cheers, Ronny Wichers Schreur ___

Re: [Haskell-cafe] Fibonacci numbers generator in Haskell

2006-06-16 Thread Mathew Mills
I guess I don't get any points for an approximate solution, ay? Is there anything that can be done (easily) to reduce the rounding errors? On 6/15/06 11:23 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: G'day all. Quoting Mathew Mills [EMAIL PROTECTED]: How about the closed form ;)

Re: [Haskell-cafe] Fibonacci numbers generator in Haskell

2006-06-16 Thread Chris Kuklewicz
Mathew Mills wrote: I guess I don't get any points for an approximate solution, ay? Is there anything that can be done (easily) to reduce the rounding errors? http://www.google.com/search?q=haskell+exact+real+arithmetic ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Fibonacci numbers generator in Haskell

2006-06-16 Thread Chris Kuklewicz
Chris Kuklewicz wrote: Mathew Mills wrote: I guess I don't get any points for an approximate solution, ay? Is there anything that can be done (easily) to reduce the rounding errors? http://www.google.com/search?q=haskell+exact+real+arithmetic Using Era.hs (with the patch at

Re: [Haskell-cafe] Fibonacci numbers generator in Haskell

2006-06-16 Thread Doug Quale
Mathew Mills [EMAIL PROTECTED] writes: Is there anything that can be done (easily) to reduce the rounding errors? The hint that I gave before is one easy way. fib :: Integer - Integer fib x = let phi = ( 1 + sqrt 5 ) / 2 in truncate( ( 1 / sqrt 5 ) * ( phi ^ x + 0.5) ) You run out

Re: [Haskell-cafe] Fibonacci numbers generator in Haskell

2006-06-16 Thread Jon Fairbairn
On 2006-06-15 at 17:33BST Vladimir Portnykh wrote: Fibonacci numbers implementations in Haskell one of the classical examples. An example I found is the following: fibs :: [Int] fibs = 0 : 1 : [ a + b | (a, b) - zip fibs (tail fibs)] Can we do better? Well, you've had various variously

[Haskell-cafe] putStrLn

2006-06-16 Thread Jenny678
Hello, Can somebody help me I want to work with putStrLn main n = putStrLn * for example How must I define the code that: main 5 * Thanks for any help -- View this message in context: http://www.nabble.com/putStrLn-t1799896.html#a4905456 Sent from the Haskell - Haskell-Cafe forum at

Re: [Haskell-cafe] putStrLn

2006-06-16 Thread J. Garrett Morris
main n = putStrLn (replicate n '*') main n = putStrLn (take n (repeat '*')) main n = sequence (take n (repeat (putStr *))) (but that doesn't have a final new line. The more complicated: main n = sequence (take (n - 1) (repeat (putStr *))) putStrLn * should solve that problem.) /g On

[Haskell-cafe] Inferring types from functional dependencies

2006-06-16 Thread Jeff . Harper
Thank you. I followed your suggestion and implemented my default Divide as you've shown below. [EMAIL PROTECTED] wrote: If we assume that we need Reciprocate only if we are going to use the 'default' method, the solution becomes obvious. It does involve overlapping and undecidable instances,

[Haskell-cafe] SMTP, HTTP, Telnet

2006-06-16 Thread Lyle Kopnicky
Hi all, Anybody know of some good Haskell libraries providing: an SMTP client, an HTTP client, or a Telnet client? There's a significant amount to these protocols, over and above the socket layer. Thanks, Lyle Kopnicky ___ Haskell-Cafe

Re: [Haskell-cafe] putStrLn

2006-06-16 Thread minh thu
you already know how to write * one ... so you just have to know how to do it the neded amount : two ways : 1/ you repeat the function 2/ you reapet the data one which the function is applied. this is like 2/ 2006/6/16, J. Garrett Morris [EMAIL PROTECTED]: main n = putStrLn

Re: [Haskell-cafe] Fibonacci numbers generator in Haskell

2006-06-16 Thread Doug Quale
Doug Quale [EMAIL PROTECTED] writes: Mathew Mills [EMAIL PROTECTED] writes: Is there anything that can be done (easily) to reduce the rounding errors? The hint that I gave before is one easy way. fib :: Integer - Integer fib x = let phi = ( 1 + sqrt 5 ) / 2 in truncate( (

[Haskell-cafe] RE: why isn't everything an instance of Data?

2006-06-16 Thread Ralf Lammel
Hi Frederik, Cc Haskell-café as proposed by Frederik, Why isn't everything an instance of Data? It seems natural to give every type which is defined via 'data' an automatic Data instance. This would make implementing many things much simpler. Certain types such as functions would only be