Re: [Haskell-cafe] Simple but interesting (for me) problem

2009-10-21 Thread Alex Queiroz
Hallo, On 10/21/09, Tim Wawrzynczak inforichl...@gmail.com wrote: Here's an example in the IO monad: import Data.IORef import System.IO.Unsafe counter = unsafePerformIO $ newIORef 0 next = do modifyIORef counter (+1) readIORef counter Naturally, this uses unsafePerformIO, which as

Re: [Haskell-cafe] Creating an alias for a function

2009-10-06 Thread Alex Queiroz
Hallo, On Tue, Oct 6, 2009 at 11:01 PM, michael rice nowg...@yahoo.com wrote: How do I create an alias for a function, like giving CAR the same functionality as HEAD. I know I can do it by creating a definition (see below), but is there a better way, like Scheme's (define head car) car

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Alex Queiroz
Hallo, On 9/30/09, ed...@ymonad.com ed...@ymonad.com wrote: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract physicists. Anyone has some suggestions? (Will be a seminar about the

Re: [Haskell-cafe] Haskell programmers in São Carlo s - SP - Brazil?

2009-05-20 Thread Alex Queiroz
Hallo, On 5/20/09, Diego Souza paravinic...@yahoo.com.br wrote: Not exactly São Carlos: São Paulo - SP. Me too, Sao Paulo - SP. Cheers, -- -alex http://www.ventonegro.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] compilation to C, not via-C

2009-04-24 Thread Alex Queiroz
Hallo, On 4/24/09, Bulat Ziganshin bulat.zigans...@gmail.com wrote: so, if you just need haskell-C++ interaction, you may look into using FFI [1,2]. if you believe that you can compile some java/ruby/haskellwhatever code down to C++ and incorporate it into your function - sorry, they all

Re: Re[2]: [Haskell-cafe] compilation to C, not via-C

2009-04-24 Thread Alex Queiroz
Hallo, On 4/24/09, Bulat Ziganshin bulat.zigans...@gmail.com wrote: and it supports lazy lists? :) all compiled languages has some FFI, the problem is that FFI limited to common subset of all those languages - i.e. primitive types and pointers I am not saying that Scheme is Haskell.

Re: [Haskell-cafe] compilation to C, not via-C

2009-04-24 Thread Alex Queiroz
Hallo, On 4/24/09, Donn Cave d...@avvanta.com wrote: Quoth Alex Queiroz asand...@gmail.com, Actually some Scheme compilers have a c-declare form that lets you create C functions, which can be called from C, Haskell, Java, Ruby etc. That would be like what you get with Haskell

Re: [Haskell-cafe] Converting IO [XmlTree] to [XmlTree]

2009-04-14 Thread Alex Queiroz
Hallo, On 4/14/09, rodrigo.bonifacio rodrigo.bonifa...@uol.com.br wrote: Dear Sirs, I guess this is a very simple question. How can I convert IO [XmlTree] to just a list of XmlTree? The short answer is: You cannot. The longer answer is: Only put things in the IO monad when you need

Re: [Haskell-cafe] Re: Against cuteness

2009-03-13 Thread Alex Queiroz
Hallo, On Fri, Mar 13, 2009 at 1:23 PM, Benjamin L. Russell dekudekup...@yahoo.com wrote: On Fri, 13 Mar 2009 12:29:25 +0100, Achim Schneider bars...@web.de Water overcomes stone: Shapeless, it requires no opening: The benefit of taking no action. Yet benefit without action, And experience

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-14 Thread Alex Queiroz
Hallo, On Wed, Jan 14, 2009 at 5:06 PM, Max Rabkin max.rab...@gmail.com wrote: On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast jonathancc...@fastmail.fm wrote: Do you have an example of a macro that can't be replaced by higher-order functions and laziness? I believe I do: one macro I found

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-14 Thread Alex Queiroz
Hallo, On Wed, Jan 14, 2009 at 5:16 PM, Max Rabkin max.rab...@gmail.com wrote: On Wed, Jan 14, 2009 at 11:11 AM, Alex Queiroz asand...@gmail.com wrote: I have one for binding GET/POST variables to regular variables transparently and with error checking, just inside the body of the macro

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-14 Thread Alex Queiroz
Hallo, On Wed, Jan 14, 2009 at 8:47 PM, Dougal Stanton ith...@gmail.com wrote: (defun avg (rest args) (/ (apply #'+ args) (length args))) Or as a macro like this: (defmacro avg (rest args) `(/ (+ ,@args) ,(length args))) The reason the macro is better is that the length of the list

Re: [Haskell-cafe] ANNOUNCE: Salsa: A .NET Bridge for Haskell

2008-10-13 Thread Alex Queiroz
Hallo, On Fri, Oct 10, 2008 at 5:48 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Don Stewart wrote: This could be a game changer. In what way? As far as I'm aware, .NET never really caught on and has long since become obsolete. Or do you just mean the type system machinery that has been

Re: [Haskell-cafe] New to Haskell

2007-12-19 Thread Alex Queiroz
Hallo, On Dec 19, 2007 9:25 PM, John Meacham [EMAIL PROTECTED] wrote: Actually, it is a pretty fundamental feature of the lisp-derived languages that they can self modify their own source, and hence keep their own source representation all the way through runtime. This is not actually

Re: [Haskell-cafe] Parsing R5RS Scheme with Parsec

2007-10-03 Thread Alex Queiroz
Hallo, On 10/3/07, Pasqualino 'Titto' Assini [EMAIL PROTECTED] wrote: Hi Alex, I hope not to spoil your fun but have you had a look at this: Write Yourself a Scheme in 48 Hours http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html Yes, I'm actually using it as a

[Haskell-cafe] Parsing R5RS Scheme with Parsec

2007-10-02 Thread Alex Queiroz
Hallo, For fun and learning I'm trying to parse R5RS Scheme with Parsec. The code to parse lists follows: -- -- Lists -- parseLeftList :: Parser [SchDatum] parseLeftList = do char '(' many parseDatum = return . filter (/= SchAtmosphere) parseDottedList :: [SchDatum] - Parser SchDatum

Re: [Haskell-cafe] Parsing R5RS Scheme with Parsec

2007-10-02 Thread Alex Queiroz
Hallo, On 10/2/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On Oct 2, 2007, at 9:52 , Alex Queiroz wrote: (parseDottedList ls) | (parseProperList ls) I've factored out the common left sub-expression in parseLeftList. The problem is that ... is a valid identifier so when

Re: [Haskell-cafe] Parsing R5RS Scheme with Parsec

2007-10-02 Thread Alex Queiroz
Hallo, On 10/2/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: Sorry, just woke up and still not quite tracking right, so I modified the wrong snippet of code. The trick is to wrap parseLeftList in a try, so the parser retries the next alternative when it fails. Since ... can

Re: [Haskell-cafe] Explaining monads

2007-08-14 Thread Alex Queiroz
Hallo, On 8/14/07, Jeff Polakow [EMAIL PROTECTED] wrote: Hello, There is clearly a problem with the Haskell/monad tutorials out there... The tutorials seriously need to step back and start with something like, To enforce order of evaluation we evaluate closures* returning a defined

Re: [Haskell-cafe] Maintaining the community

2007-07-16 Thread Alex Queiroz
Hallo, On 7/16/07, Malcolm Wallace [EMAIL PROTECTED] wrote: OK, so I'm not genuinely suggesting that you must possess or be studying for a PhD, to grok Haskell. But I find nothing alarming about the suggestion that one needs a fairly high level of intelligence, and some training, in order to

Re: [Haskell-cafe] Maintaining the community

2007-07-15 Thread Alex Queiroz
Hallo, On 7/14/07, Michael T. Richter [EMAIL PROTECTED] wrote: While it is understandable, given the intense interest most grognards of any language have in playing with the language, for people to enjoy conversations that go into the ever-more-esoteric, it is decidedly not helpful to the

Re: [Haskell-cafe] Type system madness

2007-07-11 Thread Alex Queiroz
Hallo, On 7/11/07, Andrew Coppin [EMAIL PROTECTED] wrote: When I tell the editor to save UTF-8, it inserts some weird BOM character at the start of the file - and thus, any attempt at programatically processing that file instantly fails. :-( Are you sure it's not UTF-16? Cheers, --

Re: [Haskell-cafe] Type system madness

2007-07-10 Thread Alex Queiroz
Hallo, On 7/10/07, Andrew Coppin [EMAIL PROTECTED] wrote: Last time I looked, everything treats text as being 8 bits per character. (Or, more commonly, 7, and if the MSB isn't 0, weird things happen...) That's why (for example) HTML has lots of weird constructs such as hellip; in it, instead

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Alex Queiroz
Hallo, On 7/10/07, Sebastian Sylvan [EMAIL PROTECTED] wrote: I highly doubt that. For two reasons: 1. People can only cling to unproductive and clumsy tools for so long (we don't write much assembly any more...). Capitalism works to ensure this; people who are willing to switch to more

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Alex Queiroz
Hallo, On 7/10/07, Sebastian Sylvan [EMAIL PROTECTED] wrote: That might eliminate the concurrency imperative (for a while!), but it doesn't adress the productivity point. My hypothesis is this: People don't like using unproductive tools, and if they don't have to, they won't. So you

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Alex Queiroz
Hallo, On 7/10/07, Sebastian Sylvan [EMAIL PROTECTED] wrote: The revolution (tm) won't come at the same time for all domains. C is probably used/supported in embedded devices mostly because it's popular for non-embedded devices (not because C is somehow uniquely suited for embedded devices).

Re: [Haskell-cafe] Collections

2007-06-19 Thread Alex Queiroz
Hallo, On 6/19/07, Andrew Coppin [EMAIL PROTECTED] wrote: However, Haskell only has 1 type of collection: linked lists. (And only single-linked at that.) While other normal programming languages spend huge amounts of effort trying to select exactly the right collection type for the task in

Re: [Haskell-cafe] IDE?

2007-06-18 Thread Alex Queiroz
Hallo, On 6/18/07, Michael T. Richter [EMAIL PROTECTED] wrote: Screenshots are worthless if they don't match my screen, aren't they? I guess I can open up exactly the same file that's in your screenshot and then use your screenshot as a background to my screen so I have the illusion of

Re: [Haskell-cafe] yi or not to yi was: IDE?

2007-06-18 Thread Alex Queiroz
Hallo, On 6/18/07, Andrew Coppin [EMAIL PROTECTED] wrote: OTOH... how the heck do you write an operating system in a language that doesn't even support I/O? :-S You can start from here: http://programatica.cs.pdx.edu/House/ Cheers, -- -alex http://www.ventonegro.org/

Re: [Haskell-cafe] Implementing Mathematica

2007-05-30 Thread Alex Queiroz
Hallo, On 5/30/07, Andrew Coppin [EMAIL PROTECTED] wrote: OK, so you're saying that in 4 days you wrote something that out-performs Mathematica, a program that has existed for decades and has a vast, highly-funded RD effort behind it featuring some of the brightest minds in the field? I'm in

Re: [Haskell-cafe] Editor

2007-05-21 Thread Alex Queiroz
Hallo, On 5/21/07, Michael T. Richter [EMAIL PROTECTED] wrote: Oh, and of course it wasn't just the config files I showed problems with, now, was it? I seem to remember something about modality and bad syntax highlighting. Maybe I was tripping. It happens. You may not like

Re: [Haskell-cafe] Poor first impression

2007-04-27 Thread Alex Queiroz
Hallo, On 4/27/07, Fernando Cassia [EMAIL PROTECTED] wrote: Goodbye Haskell, I just wanted to compile a MP3 player, and perhaps if the compiler installed OK with no issues, I'd have taken a look at the language. But as of right now, I don't have time to waste with broken compiler installers.

Re: [Haskell-cafe] Multi Line String literals

2007-04-26 Thread Alex Queiroz
Hallo, On 4/26/07, Neil Mitchell [EMAIL PROTECTED] wrote: Like the cpp will choke and die :) Multiline string literals were one of the motivations for cpphs. Does cpphs allow me to include a whole file into a Haskell source file, inserting automatically the string gaps? -- -alex

Re: [Haskell-cafe] Multi Line String literals

2007-04-26 Thread Alex Queiroz
Hallo, On 4/26/07, Neil Mitchell [EMAIL PROTECTED] wrote: No, but Hugs does with Here documents. Unfortunately I'm using GHC but thanks! Cheers, -- -alex http://www.ventonegro.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Why Perl is more learnable than Haskell

2007-04-12 Thread Alex Queiroz
Hallo, On 4/12/07, kynn [EMAIL PROTECTED] wrote: Hi. I can't find that post. Could you point it to me please? It's in here: http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10#programmable-semicolons -- -alex http://www.ventonegro.org/ ___

Re: [Haskell-cafe] Why Perl is more learnable than Haskell

2007-04-11 Thread Alex Queiroz
Hallo, On 4/11/07, riccardo cagnasso [EMAIL PROTECTED] wrote: The post on dons' blog about the cpu scaler is a great example on how haskell can easily used in the day-to-day hacking! Just read it, it's a very nice post. I'm not afraid of math, but it's a relief to see some code I can

Re: [Haskell-cafe] Re: A question about functional dependencies and existential

2007-03-29 Thread Alex Queiroz
Hallo, On 3/29/07, Nicolas Frisby [EMAIL PROTECTED] wrote: A wee bit off topic... but bear with me. More off-topic... but bear with me. :-) I'm starting with Haskell. I'm writing a real application with Gtk2hs and HDBC for a small furniture shop. I have enjoyed it very much so far, and I

[Haskell-cafe] Newbie vs. laziness

2007-03-20 Thread Alex Queiroz
Hallo list, I don't quite get how ($!) works. I have this function: dbCreateIndices con dtn dof = do let dummy = newDbItem let query = SELECT id FROM ++ (dtn dummy) ++ ORDER BY ++ (dof dummy) ids - liftM (map fromSql . concat ) $! quickQuery con query [] return $ IntMap.fromList

Re: [Haskell-cafe] Newbie vs. laziness

2007-03-20 Thread Alex Queiroz
Hallo, On 3/20/07, Jules Bean [EMAIL PROTECTED] wrote: What $! does is force its arguments into WHNF before applying the function. WHNF means, roughly, either a lambda or a constructor at the top-level. I think I got it now. However that's a bit clumsy. What kind of error are you

Re: [Haskell-cafe] Newbie vs. laziness

2007-03-20 Thread Alex Queiroz
Hallo, On 3/20/07, Jules Bean [EMAIL PROTECTED] wrote: Personally I'd inclined to suggest use of the strict FetchRow which the library provides than struggle with explicit uses of seq to fight an over-lazy IO action. Sounds like a good suggestion. Thanks very much for the help! Cheers,

Re: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Alex Queiroz
Hallo, On 3/14/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote: Ah, a fine idea. I'll do that anyway; maybe others will have even better ideas, but that's a good start Ah! So now I knows what it means. I've also been beaten by this error message a couple of days ago. Cheers, -- -alex

Re: [Haskell-cafe] Re: HDBC Windows binaries with SQLite 3 support

2007-03-06 Thread Alex Queiroz
Hallo, On 3/6/07, John Goerzen [EMAIL PROTECTED] wrote: I should add, though, that you were pointing to the old HDBC site. Please download HDBC from http://software.complete.org/hdbc/downloads The Sqlite3 driver is at http://software.complete.org/hdbc-sqlite3/downloads The quux.org download

[Haskell-cafe] HDBC Windows binaries with SQLite 3 support

2007-03-05 Thread Alex Queiroz
Hallo list, I guess the subject line says it all. Can anybody help me? -- -alex http://www.ventonegro.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: HDBC Windows binaries with SQLite 3 support

2007-03-05 Thread Alex Queiroz
Hallo, On 3/5/07, ArtemGr [EMAIL PROTECTED] wrote: My instructions (i made it for myself! provided as is): Worked after some tweaks for my system. It was actually much easier than I thought. Thanks very much! -- -alex http://www.ventonegro.org/

[Haskell-cafe] LGPL libraries

2007-03-05 Thread Alex Queiroz
Hallo, Gtk2Hs and HDBC are both LGPL licensed, but aren't they always static linked? Is there a way to use them in closed-source programs? Cheers, -- -alex http://www.ventonegro.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] LGPL libraries

2007-03-05 Thread Alex Queiroz
Hallo, On 3/5/07, Duncan Coutts [EMAIL PROTECTED] wrote: If you're really worried (but I wouldn't be) then do recall that the static linking thing only requires that the end user be able to relink with a different version that preserves the same ABI. So you don't have to provide source for

Re: [Haskell-cafe] basic field questions

2007-01-24 Thread Alex Queiroz
Hallo, On 1/24/07, jamin1001 [EMAIL PROTECTED] wrote: So then how should this be done? What if I want to do something like data Chair = Chair {pos:: Int, color :: Int} data Table = Table {pos:: Int, color :: Int} data Chair = Chair { chairPos :: Int, chairColor :: Int } Also, could

Re: [Haskell-cafe] basic field questions

2007-01-24 Thread Alex Queiroz
Hallo, On 1/24/07, Ketil Malde [EMAIL PROTECTED] wrote: jamin1001 wrote: What if I want to do something like data Chair = Chair {pos:: Int, color :: Int} data Table = Table {pos:: Int, color :: Int} data Properties = Props { pos, color :: Int } data Chair = Chair Props data Table = Table

Re: [Haskell-cafe] Beta Gtk2Hs Getting Started

2007-01-09 Thread Alex Queiroz
Hallo, On 1/8/07, Hans van Thiel [EMAIL PROTECTED] wrote: Thanks, I didn't know that. What other widget libraries are supported at this time? Only GTK+. :-) -- -alex http://www.ventonegro.org/ ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Beta Gtk2Hs Getting Started

2007-01-08 Thread Alex Queiroz
Hallo, On 1/8/07, Hans van Thiel [EMAIL PROTECTED] wrote: Hello All, The beta of the 'Gtk2Hs:Getting Started' short tutorial for beginners, Haskell GUI for Dummies, if you like :-) can be viewed at http://j-van-thiel.speedlinq.nl/gtk2hs/gtk2hsGetStart.html Nitpicking: Glade does not

Re: [Haskell-cafe] Building the community

2006-12-14 Thread Alex Queiroz
Hallo, On 12/14/06, Paul Moore [EMAIL PROTECTED] wrote: But overall I'd agree, this is a very helpful community - it's just that you all seem so much cleverer than I, so I'm not sure I'll ever be smart enough to write Haskell programs :-) (50% joke...) I know the feeling. :-) -- -alex

Re: [Haskell-cafe] Aim Of Haskell

2006-12-13 Thread Alex Queiroz
Hallo, On 12/13/06, Claus Reinke [EMAIL PROTECTED] wrote: we have had lots of languages that were intended to be well-designed (good, beautiful, ..), but never much used in practice, and we have also had lots of languages that were intended to be pragmatic (practical, useful, ..), without much

Re: [Haskell-cafe] Large data structures

2006-12-12 Thread Alex Queiroz
Hallo, On 12/11/06, Matthew Brecknell [EMAIL PROTECTED] wrote: Yes. Take a look at Data.Map. This data structure provides various operations which create a new map from an old one in O(log n) time, by splicing bits of the old map into the new one. Importantly, performing any of these

Re: [Haskell-cafe] Re: Large data structures

2006-12-12 Thread Alex Queiroz
Hallo, On 12/12/06, Benjamin Franksen [EMAIL PROTECTED] wrote: Alex Queiroz wrote: On 12/11/06, Stefan O'Rear [EMAIL PROTECTED] wrote: No. Haskell's lists are linked lists, enlarge creates a single new link without modifying (and copying) the original. Thanks. Is there a way to mimic

[Haskell-cafe] Large data structures

2006-12-11 Thread Alex Queiroz
Hi all, I'm considering the use of Haskell to manipulate large data structures for Computer Graphics (large geometric datasets). I'm wondering what's the best way to do it. As objects (not in the OO sense) in Haskell are immutable, how can I add a vertex to a large mesh without using obscene

Re: [Haskell-cafe] Large data structures

2006-12-11 Thread Alex Queiroz
Hallo, On 12/11/06, Stefan O'Rear [EMAIL PROTECTED] wrote: No. Haskell's lists are linked lists, enlarge creates a single new link without modifying (and copying) the original. ___ Thanks. Is there a way to mimic this behaviour with my own

Re: [Haskell-cafe] Re: The Future of MissingH

2006-11-27 Thread Alex Queiroz
Hallo, On 11/27/06, Max Vasin [EMAIL PROTECTED] wrote: A small addition: some GPLed libraries (libstdc++ AFAIK) allow linking with proprietary software by adding clause to lisence which relaxes GPL requirements. Nope, it's LGPL with an extra binary linking permission. Cheers, -- -alex

Re: [Haskell-cafe] Re: best Linux for GHC?

2006-11-13 Thread Alex Queiroz
Hallo, On 11/13/06, Mark T.B. Carroll [EMAIL PROTECTED] wrote: How up to date will Debian unstable's GHC be kept, though? It seems pretty good at the moment, but there have been times when we've had to install from source instead of via Debian earlier this year so that we had GHC features and

Re: [Haskell-cafe] Is Haskell a 5GL?

2006-09-25 Thread Alex Queiroz
Hallo, On 9/25/06, Ch. A. Herrmann [EMAIL PROTECTED] wrote: Hi, Henning Thielemann wrote: assembly language (Assembler ist deutsch :-) for mysterious reasons it entered the English world. 'Assembly' is a language. 'Assembler' is a program. -- -alex http://www.ventonegro.org/

Re: [Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Alex Queiroz
Hallo, On 9/21/06, Bill Wood [EMAIL PROTECTED] wrote: I have only recently started accessing some web fora, but I've noticed that some of those powered by phpBB are vulnerable to spamming, whereas the news groups seem to be less so. For example, the python-forum has nearly lost it's General

Re: [Haskell-cafe] does the compiler optimize repeated calls?

2006-09-06 Thread Alex Queiroz
Hallo, On 9/6/06, Tamas K Papp [EMAIL PROTECTED] wrote: PS: I realize that I am asking a lot of newbie questions, and I would like to thank everybody for their patience and elucidating replies. I am a newbie myself (second week of learning Haskell), but I'll give it a shot: Since

Re: [Haskell-cafe] Re: does the compiler optimize repeated calls?

2006-09-06 Thread Alex Queiroz
Hallo, On 9/6/06, Lennart Augustsson [EMAIL PROTECTED] wrote: Furthermore, doing that optimization (common subexpression elimination) can lead to space leaks. So you should not count on the compiler doing it. Besides, I often find it more readable and less error prone to name a common