Re: [Haskell-cafe] GHC vs GCC

2010-03-26 Thread Rafael Almeida
On Fri, Mar 26, 2010 at 10:42 PM, Bernie Pope florbit...@gmail.com wrote: On 27 March 2010 04:46, Rafael Cunha de Almeida almeida...@gmail.com wrote: During a talk with a friend I came up with two programs, one written in C and another in haskell. snip The Haskell version: real    

Re: [Haskell-cafe] GHC vs GCC

2010-03-26 Thread Rafael Almeida
On Fri, Mar 26, 2010 at 6:49 PM, Jason Dagit da...@codersbase.com wrote: On Fri, Mar 26, 2010 at 2:33 PM, Bryan O'Sullivan b...@serpentine.com wrote: On Fri, Mar 26, 2010 at 10:46 AM, Rafael Cunha de Almeida almeida...@gmail.com wrote: During a talk with a friend I came up with two

[Haskell-cafe] Template Haskell

2010-03-19 Thread Rafael Almeida
I was reading the good old template haskell paper by Sheard and Peyton Jones [1]. It looks like some API have changed, but things seems to be more or less the same. I got the printf example to run, and it is an alright example of something to do with template haskell. You lose the ability to use

Re: [Haskell-cafe] Space leak

2010-03-13 Thread Rafael Almeida
On Sat, Mar 13, 2010 at 8:58 PM, Arnoldo Muller arnoldomul...@gmail.com wrote: Jason, I am trying to use haskell in the analysis of bio data. One of the main reasons I wanted to use haskell is because lazy I/O allows you to see a large bio-sequence as if it was a string in memory. In order

Re: [Haskell-cafe] GPL answers from the SFLC (WAS: Re: ANN: hakyll-0.1)

2010-03-05 Thread Rafael Almeida
On Fri, Mar 5, 2010 at 2:59 PM, Job Vranish job.vran...@gmail.com wrote: This seems really confusing. It would imply that if I write a library that is designed to talk to some part of the linux kernel API (which is GPL'd) then I'd have to release my library under the GPL. And anything that

Re: [Haskell-cafe] Plotting parametric functions in Haskell

2009-09-14 Thread Rafael Almeida
On Mon, Sep 14, 2009 at 6:37 AM, Peter Verswyvelen bugf...@gmail.com wrote: I did that once a long time ago using GTK2HS; but I don't have that code anymore I think, it was a quick hack anyway. Doing a search for plot on Hackage revealed http://hackage.haskell.org/package/Chart

Re: [Haskell-cafe] Re: [Haskell] Looking for a new HWN editor

2009-09-08 Thread Rafael Almeida
On Tue, Sep 8, 2009 at 8:16 AM, Benjamin L.Russelldekudekup...@yahoo.com wrote: On Sat, 5 Sep 2009 19:34:24 -0400, Brent Yorgey byor...@seas.upenn.edu wrote: On Sat, Sep 05, 2009 at 05:26:08PM -0400, Brent Yorgey wrote: Executive summary:   * I'm looking for someone to take over as HWN

[Haskell-cafe] On the parallel between java annotations and monads

2009-07-03 Thread Rafael Almeida
Hello, After an extensive search (5 minutes googling) I could not find any comparison between Java annotations (or Python annotations for that matter) and Monads. I think they are similar in various aspects and I want to discuss them here. I'm sure several of you have experience with Java

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

2008-09-15 Thread Rafael Almeida
On Mon, Sep 15, 2008 at 2:43 PM, Robin Green [EMAIL PROTECTED] wrote: On Mon, 15 Sep 2008 13:05:11 -0300 Rafael C. de Almeida [EMAIL PROTECTED] wrote: Someone mentioned coq, I read a bit about it, but it looked really foreign to me. The idea is to somehow prove somethings based only on the

Re: [Haskell-cafe] Re: Should `(flip (^^))` work?

2008-09-15 Thread Rafael Almeida
On Mon, Sep 15, 2008 at 8:09 PM, Mauricio [EMAIL PROTECTED] wrote: Rafael C. de Almeida a écrit : Derek Elkins wrote: On Mon, 2008-09-15 at 18:42 -0300, Mauricio wrote: Hi, I tested the expression below and it doesn't work. Is there some way to achieve that (i.e., turning an

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] Solving a geometry problem with Haskell

2008-01-13 Thread Rafael Almeida
On Sat, 12 Jan 2008 23:36:43 +0100, Daniel Fischer [EMAIL PROTECTED] wrote: Am Samstag, 12. Januar 2008 22:48 schrieb Luke Palmer: On Jan 12, 2008 9:19 PM, Rafael Almeida [EMAIL PROTECTED] wrote: After some profiling I found out that about 94% of the execution time is spent

Re: AW: [Haskell-cafe] Solving a geometry problem with Haskell

2008-01-13 Thread Rafael Almeida
On Sun, 13 Jan 2008 11:48:09 +0100, Nicu Ionita [EMAIL PROTECTED] wrote: Hi Rafael, I have just two ideas, that could improve your strategy to reduce the computation time: 1. perhaps there is also a minimum (not only a maximul) for the values you should try Yeah, that's a good one, the

[Haskell-cafe] Solving a geometry problem with Haskell

2008-01-12 Thread Rafael Almeida
Hello, I have been browsing through the problems at projecteuler.net and I found one that seemed interesting. It's the problem 176, I'll state it here: The four rectangular triangles with sides (9,12,15), (12,16,20), (5,12,13) and (12,35,37) all have one of the shorter sides

Re: [Haskell-cafe] building a regular polygon

2007-08-19 Thread Rafael Almeida
On 8/19/07, Frank Buss [EMAIL PROTECTED] wrote: (*) Exercise 2.2 Define a function regularPolygon :: Int - Side - Shape such that regularPolygon n s is a regular polygon with n sides, each of length s. (Hint: consider using some of Haskell's trigonometric functions, such as sin ::

Re: [Haskell-cafe] Re: Just for a laugh...

2007-06-03 Thread Rafael Almeida
The site seems to be asking for the internal floating point representation. So it doesn't matter if it's IEEE 754, if the ints are 2-complements, or whatever. I used this code as a quick hack for one of my programs, but I think it would work in this case. It should work for any Storable type.

Re: [Haskell-cafe] Re: Just for a laugh...

2007-06-03 Thread Rafael Almeida
On 6/3/07, Rafael Almeida [EMAIL PROTECTED] wrote: The site seems to be asking for the internal floating point representation. So it doesn't matter if it's IEEE 754, if the ints are 2-complements, or whatever. I used this code as a quick hack for one of my programs, but I think it would work

Re: [Haskell-cafe] Is there a best *nix or BSD distro for Haskell hacking?

2007-04-23 Thread Rafael Almeida
All in all it doesn't really matter what system you run. What you really need is a haskell compiler or interpreter installed, preferable one compatible with the standard and latest version of programs you may want to research. Use the system you alredy know how it works so the OS won't bug you

Re: [Haskell-cafe] Very fast loops. Now!

2007-02-10 Thread Rafael Almeida
On 2/10/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: The following C program was described on #haskell #include stdio.h int main() { double x = 1.0/3.0; double y = 3.0; int i= 1; for (; i=10; i++) { x = x*y/3.0;

Re: [Haskell-cafe] Very fast loops. Now!

2007-02-10 Thread Rafael Almeida
On 2/10/07, Felipe Almeida Lessa [EMAIL PROTECTED] wrote: Under gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5), the following asm code is generated for part of the main function: mov dword ptr [esp+4], 0aaabh mov dword ptr [esp+8], 400ah mov dword

Re: [Haskell-cafe] Re: Optimization fun

2007-02-10 Thread Rafael Almeida
I've always found the following definition of the sieve of eratosthenes the clearest definition one could write: sieve [] = [] sieve (x:xs) = x : sieve [y | y - xs, y `mod` x /= 0] It doesn't perform better than Augustsson's solution. It does fairly worse, actually, but it performs way better

Re: [Haskell-cafe] Beginner Question

2007-02-10 Thread Rafael Almeida
On 2/9/07, vishy anand [EMAIL PROTECTED] wrote: I have just started on my journey in learning Haskell.I have started off reading wikibook,then will read yet another tutorial on haskell.Please guide me if I am on right track The book I used on my learning was Haskell: the craft of functional