Re: [Haskell-cafe] State Variables

2006-05-29 Thread Alberto Ruiz
On Sunday 28 May 2006 23:38, Matthew Bromberg wrote: I've been toying with the idea of using Haskell to write a medium sized simulation of a wireless network. However I have a number of concerns as I've begun to program a bit more in Haskell. The first concern is that the simulation needs

Re: [Haskell-cafe] State Variables

2006-05-29 Thread minh thu
ah... simulation in haskell ... that's a thing i thought a bit of .. (disclaimer : i'm not so good at haskell, so... :) here how i've started : you have your global state : it's a bunch of IORef or STRef. Each one maps to one of the individual thing you want to update. You can choose the

Re: [Haskell-cafe] State Variables

2006-05-29 Thread Bulat Ziganshin
Hello Matthew, Monday, May 29, 2006, 1:38:38 AM, you wrote: The third and final concern is the point of this post. How does one handle state efficiently in Haskell? I've seen the various state monads and gained a superficial enough understanding to be concerned about how useful they are,

Re: [Haskell-cafe] State Variables

2006-05-29 Thread minh thu
hi, Bulat, i quote the doc for Data.Array.Storable : It is similar to IOUArray but slower. Its advantage is that it's compatible with C. So you speak about Storable because Matthew wants to use BLAS and LAPACK ? Cheers, mt 2006/5/29, Bulat Ziganshin [EMAIL PROTECTED]: Hello Matthew, Monday,

[Haskell-cafe] OT - lamba calculus definition - alpha reduction

2006-05-29 Thread Dušan Kolář
Hello all, I'm asking in place of several my colleagues and myself of course. The question is almost off topic. It is from lambda calculus definition, in particular, definition of alpha reduction (and others as well). Alpha reduction definition: a lambda expression (\v.e) can be

Re: [Haskell-cafe] OT - lamba calculus definition - alpha reduction

2006-05-29 Thread Matthieu Sozeau
Le 29 mai 06 à 14:30, Dušan Kolář a écrit : Hello all, I'm asking in place of several my colleagues and myself of course. The question is almost off topic. It is from lambda calculus definition, in particular, definition of alpha reduction (and others as well). Alpha reduction

Re: [Haskell-cafe] OT - lamba calculus definition - alpha reduction

2006-05-29 Thread Dušan Kolář
I'm asking in place of several my colleagues and myself of course. The question is almost off topic. It is from lambda calculus definition, in particular, definition of alpha reduction (and others as well). Alpha reduction definition: a lambda expression (\v.e) can be transformed

Re: [Haskell-cafe] OT - lamba calculus definition - alpha reduction

2006-05-29 Thread Brian Hulley
Dušan Kolář wrote: [snip] OK. If we have these two expressions: 1) (\x.x b x) 2) (\x.x c x) The question is, are they equal? (They are not identical, of course.) For answer no, there is a strong argument - there is no reduction sequence that can make these identical. On the other hand, their

Re: [Haskell-cafe] OT - lamba calculus definition - alpha reduction

2006-05-29 Thread Jon Fairbairn
On 2006-05-29 at 15:46+0200 =?UTF-8?B?RHXFoWFuIEtvbMOhxZk=?= wrote: OK. If we have these two expressions: 1) (\x.x b x) 2) (\x.x c x) The question is, are they equal? (They are not identical, of course.) For answer no, there is a strong argument - there is no reduction sequence

[Haskell-cafe] (no subject)

2006-05-29 Thread Christophe Poucet
Dear, I will try to explain what I'm trying to achieve, below you can find the code demonstrating where I'm at currently, and where I would like to ideally get, as well as the current compilation error. Basically I'm working on a minilanguage that I would like to simulate. This language is

[Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Brian Hulley
[moved to cafe] Dominic Steinitz wrote: Taral wrote: On 5/28/06, Dominic Steinitz [EMAIL PROTECTED] wrote: Is this defined in some library? Thanks, Dominic. Don't think so. I use: \a b - f (g a b) Taral, Thanks. What prompted this question is that I find myself writing things like: foo

Re: [Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Donald Bruce Stewart
brianh: [moved to cafe] Dominic Steinitz wrote: Taral wrote: On 5/28/06, Dominic Steinitz [EMAIL PROTECTED] wrote: Is this defined in some library? Thanks, Dominic. Don't think so. I use: \a b - f (g a b) Taral, Thanks. What prompted this question is that I find myself writing

Re: [Haskell-cafe] State Variables

2006-05-29 Thread Matthew Bromberg
Yes that's true, if the problem could be formulated as monolothic operations on large matrices, then Matlab will be as fast as anything else. My current Matlab implementation, however, generates hundreds of 'small' matrices (say 32 x 32 complex roughly) and does nasty order cubic operations on

Re: [Haskell-cafe] State Variables

2006-05-29 Thread Matthew Bromberg
How hard would it be to build 6.5 on a windows box without visual studio 2003? Regards Bulat Ziganshin wrote: Hello minh, Monday, May 29, 2006, 2:01:29 PM, you wrote: hi, Bulat, i quote the doc for Data.Array.Storable : It is similar to IOUArray but slower. Its advantage is

Re: [Haskell-cafe] State Variables

2006-05-29 Thread Matthew Bromberg
What is the difference between the ForeignArray defined in this source and the StorableArray? The source code of both modules are very similar. Bulat Ziganshin wrote: Hello minh, Monday, May 29, 2006, 2:01:29 PM, you wrote: hi, Bulat, i quote the doc for Data.Array.Storable

[Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Dominic Steinitz
Brian Hulley wrote: Hi Dominic - I hope it's ok for me to ask this question and I'm absolutely burning with curiosity to find out the answer... How did you know to write ((.).(.)) instead of (\f g a b - f (g a b)) ? Brian, I can't remember. I certainly don't find it intuitive. I think it

[Haskell-cafe] How to print the character without the backslash

2006-05-29 Thread Nuno Santos
Hi, I have this basic question of how to print the character without the backslash. I'm trying to print html code, so i need a lot. giveHtml (Leaf (a,(b,c))) = frame src=\\ name=\ ++ [a] ++ \ scrolling=\No\ noresize=\noresize\ id=\ ++ [a] ++ \ title=\ ++ [a] ++ \ / Can anybody give

Re: [Haskell-cafe] How to print the character without the backslash

2006-05-29 Thread Neil Mitchell
Hi I have this basic question of how to print the character without the backslash. I'm trying to print html code, so i need a lot. giveHtml (Leaf (a,(b,c))) = frame src=\\ name=\ ++ [a] ++ \ scrolling=\No\ noresize=\noresize\ id=\ ++ [a] ++ \ title=\ ++ [a] ++ \ / Can anybody give me a

Re: [Haskell-cafe] How to print the character without the backslash

2006-05-29 Thread Brian Hulley
Nuno Santos wrote: Hi, I have this basic question of how to print the character without the backslash. I'm trying to print html code, so i need a lot. giveHtml (Leaf (a,(b,c))) = frame src=\\ name=\ ++ [a] ++ \ scrolling=\No\ noresize=\noresize\ id=\ ++ [a] ++ \ title=\ ++ [a] ++ \ / Can

[Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Brian Hulley
Dominic Steinitz wrote: Brian Hulley wrote: Hi Dominic - I hope it's ok for me to ask this question and I'm absolutely burning with curiosity to find out the answer... How did you know to write ((.).(.)) instead of (\f g a b - f (g a b)) ? Brian, I can't remember. I certainly don't find it

Re: [Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Brian Hulley
Donald Bruce Stewart wrote: brianh: How did you know to write ((.).(.)) instead of (\f g a b - f (g a b)) ? If you play with the @pointless plugin in lambdabot http://haskell.org/haskellwiki/Pointfree Thanks for pointing this out :-) I'm reminded of Spock rebuilding his mind with the

Re[2]: [Haskell-cafe] State Variables

2006-05-29 Thread Bulat Ziganshin
Hello Matthew, Monday, May 29, 2006, 8:04:56 PM, you wrote: What is the difference between the ForeignArray defined in this source and the StorableArray? The source code of both modules are very similar. the devil in details :) - StorableArray in 6.4 is slow because it uses ForeignPtr. there

Re: [Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Jon Fairbairn
On 2006-05-29 at 19:03BST Brian Hulley wrote: Dominic Steinitz wrote: I think it's fascinating that already with ((.).(.)) there is something that can be used practically and proved equivalent to something easily comprehensible, Well, it is compose composed with compose, so you can start

[Haskell-cafe] String to binary tree

2006-05-29 Thread Nuno Santos
Hi, I have this type which represents polish expressions (floorplan representation): data PeAux a = Folha Char | Nodo Char (PeAux a) (PeAux a) deriving Show The reverse polish expression are the result of doing a post order visit to the tree One example of this reverse polish

Re: [Haskell-cafe] State Variables

2006-05-29 Thread Matthew Bromberg
If possible I'd like to memory manage on the Haskell side. All of the calls to BLAS and LAPACK that I'm aware of assume that all arrays are allocated outside of the C or Fortran that implement the matrix algorithms. They never return buffers to newly allocated arrays. So what I'd like to do is

Re: [Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Brian Hulley
Jon Fairbairn wrote: On 2006-05-29 at 19:03BST Brian Hulley wrote: Dominic Steinitz wrote: I think it's fascinating that already with ((.).(.)) there is something that can be used practically and proved equivalent to something easily comprehensible, Well, it is compose composed with

Re: [Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Fritz Ruehr
On May 29, 2006, at 9:33 AM, Dominic Steinitz wrote: Hi Dominic - I hope it's ok for me to ask this question and I'm absolutely burning with curiosity to find out the answer... How did you know to write ((.).(.)) instead of (\f g a b -> f (g a b)) ? Brian, I can't remember. I certainly don't

[Haskell-cafe] swap a pair of integers

2006-05-29 Thread Jenny678
hello, i want swap a pair of integers for example Main 17 out 71 Can somebody help me? -- View this message in context: http://www.nabble.com/swap+a+pair+of+integers-t1700880.html#a4615989 Sent from the Haskell - Haskell-Cafe forum at Nabble.com. ___

Re: [Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Brian Hulley
Brian Hulley wrote: Jon Fairbairn wrote: You've read http://www.amazon.co.uk/exec/obidos/ASIN/0444875085/qid=1148927765/sr=1-1/ref=sr_1_0_1/203-8973698-1827131 I presume? ;-) It's a bestseller... I must admit I haven't read it... Are you saying that this book contains the knowledge I'd need

Re: [Haskell-cafe] swap a pair of integers

2006-05-29 Thread David House
This was originally, and accidentally, sent to just Jenny, and not the list. On 29/05/06, Jenny678 [EMAIL PROTECTED] wrote: hello, i want swap a pair of integers for example Main 17 out 71 Can somebody help me? When you want to do manipulation on the digits of a number like this, normally the

Re: [Haskell-cafe] Re: help with MPTC for type proofs?

2006-05-29 Thread David Roundy
On Sat, May 27, 2006 at 11:00:43AM -0400, Stefan Monnier wrote: I'm thinking that either the functional dependency constraint is weaker than I thought, or that somehow GADTs aren't interacting with FDs as I'd like, but I'm not sure which. Or, of course, it may be that my recursive

Re: [Haskell-cafe] swap a pair of integers

2006-05-29 Thread Tim Toorop
David House wrote: When you want to do manipulation on the digits of a number like this, normally the easiest thing to do is to convert it to a string, use list manipulation functions, then convert back to an integer. For example: Prelude (read . reverse . show) 17 71 swapInteger :: Integer

Re: [Haskell-cafe] Haskell RPC

2006-05-29 Thread Bjorn Bringert
On May 25, 2006, at 11:00 AM, Joel Reymont wrote: Folks, I'm curious about how the following bit of Lisp code would translate to Haskell. This is my implementation of Lisp RPC and it basically sends strings around, printed readably and read on the other end by the Lisp reader. If I have

Re: [Haskell-cafe] Editors for Haskell

2006-05-29 Thread Bjorn Bringert
Hi Chris, I followed your advice and tried SubEthaEdit. It seems to work really well, except that I can't figure out how to get it to indent my Haskell code correctly. What I expected was something like the Emacs Haskell mode where I can hit tab to cycle between the different reasonable

Re: [Haskell-cafe] Editors for Haskell

2006-05-29 Thread Mathew Mills
With Haskell's lovely strong static typing, it is a crying shame we don't have an editor with immediate feedback, ala Eclipse. On 5/29/06 6:55 PM, Bjorn Bringert [EMAIL PROTECTED] wrote: Hi Chris, I followed your advice and tried SubEthaEdit. It seems to work really well, except that I

[Haskell-cafe] On GADT, phantom types, etc. terminology

2006-05-29 Thread oleg
David Roundy wrote: data CommuteResult a b c where CR :: C a b c d = (P a d, P d c) - CommuteResult a b c ... or that somehow GADTs aren't interacting with FDs as I'd like It must be emphasized that there are *NO* GADTs is the above code. Except Stefan Monnier's message, no code posted

Re: [Haskell-cafe] String to binary tree

2006-05-29 Thread Thorkil Naur
Hello, It seems that what you need is the technique of evaluating an expression in reverse polish notation by using a stack. This technique is well known in subjects related to compiler construction. Basically, the expression (list of operands and operators) is processed sequentially from