[Haskell-cafe] On hGetContents semi-closenesscloseness

2011-02-15 Thread Rafael Cunha de Almeida
From http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html: Computation hGetContents hdl returns the list of characters corresponding to the unread portion of the channel or file managed by hdl, which is put into an intermediate state,

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-03 Thread Rafael Cunha de Almeida
Ivan Miljenovic ivan.miljeno...@gmail.com disse: On 3 May 2010 14:17, aditya siram aditya.si...@gmail.com wrote: I'm a little confused about this too. I've seen many functions defined like: f x = (\s - ...) which is a partial function because it returns a function and is the same as: f x s =

Re: [Haskell-cafe] Re: Haskellers hate GUIs!!

2010-04-02 Thread Rafael Cunha de Almeida
Stephen Tetley stephen.tet...@gmail.com disse: On 2 April 2010 17:53, Dominic Espinosa dces...@fastmail.fm wrote: [SNIP] I ended up rewriting it in another language (due to time pressure) and I'm a little wary of attempting to use Haskell again for developing such an application. Hi

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Rafael Cunha de Almeida
John Meacham wrote: Here are jhc's timings for the same programs on my machine. gcc and ghc both used -O3 and jhc had its full standard optimizations turned on. jhc: ./hs.out 5.12s user 0.07s system 96% cpu 5.380 total gcc: ./a.out 5.58s user 0.00s system 97% cpu 5.710 total ghc:

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Rafael Cunha de Almeida
Lennart Augustsson wrote: It's important to switch from mod to rem. This can be done by a simple abstract interpretation. I'm nore sure if it's jhc or gcc that does this for jhc. It's not just adding rem. Ghc still runs much slower using rem. It's only when switching to -fvia-C and using

[Haskell-cafe] GHC vs GCC

2010-03-26 Thread Rafael Cunha de Almeida
Hello, During a talk with a friend I came up with two programs, one written in C and another in haskell. Haskell main :: IO () main = print $ rangeI 0 0 rangeK :: Int - Int - Int - Int - Int rangeK i j k acc | k 1000 = if i *

[Haskell-cafe] Plotting parametric functions in Haskell

2009-09-13 Thread Rafael Cunha de Almeida
Hello, I think it would be interesting to plot and visualize parametric (and other kind of functions) using the haskell language to define them [functions]. Does anyone know about some software or API that does just that? I started writing a plotter to do that using hopengl. But my computer

Re: [Haskell-cafe] ANNOUNCE: Palindromes 0.1

2009-09-07 Thread Rafael Cunha de Almeida
Johan Jeuring wrote: Palindromes == Palindromes is a package for finding palindromes in files. Visit the homepage http://www.jeuring.net/Palindromes/ A few options are not working well: $ ./palindromes --h * *

Re: [Haskell-cafe] Function to cast types

2009-03-22 Thread Rafael Cunha de Almeida
John Dorsey wrote: Anonymous One, I'm new to haskell, I'm wondering how can you write a function that will do the following: fromIntToString :: Int - String Is this a homework assignment, perchance? Please take a look at http://www.haskell.org/haskellwiki/Homework_help Everyone here is

Re: [Haskell-cafe] Re: Sometimes I wish there was a global variable

2009-03-22 Thread Rafael Cunha de Almeida
Maurí­cio wrote: Notice that rotX, rotY and pos are meant to be used as comunication between the keyboardMouse and display functions. They need to be set as 0 first, so display won't do anything. Only when they user press a few buttons that those values change, so display behaves accordanly.

[Haskell-cafe] ghci + hopengl

2009-03-21 Thread Rafael Cunha de Almeida
Hello, I'm writing a program for plotting vectorial functions and maybe something else in the future. My goal is to be able to have the following usage: Prelude :l Galo.hs Prelude Galo show3Dvec (\t - (t, t, 0)) [0.0,0.01 .. 1.0] * shows graph * Prelude Galo

[Haskell-cafe] Sometimes I wish there was a global variable

2009-03-21 Thread Rafael Cunha de Almeida
Hello, I am writing a OpenGL program in haskell, it can be found in: http://github.com/aflag/galo/tree/master But I hope this e-mail will be self-contained :). My main function goes like this: (...) rotX - newIORef (0.0::GLfloat) rotY - newIORef (0.0::GLfloat) pos -