Re: Re[2]: [Haskell-cafe] How to variables

2005-07-18 Thread Bernard Pope
On Tue, 2005-07-19 at 09:48 +0400, Bulat Ziganshin wrote: > Hello robert, > > Monday, July 18, 2005, 10:14:43 PM, you wrote: > > > rd> main = loop 0 0 0 -- initial values > rd> where loop loop_num xpos ypos = > rd> do e <- pollEvent > rd> let xpos' = > rd>

Re[2]: [Haskell-cafe] How to variables

2005-07-18 Thread Bulat Ziganshin
Hello yin, Tuesday, July 19, 2005, 12:39:24 AM, you wrote: y> I saw it. The problem is, I need an amount of 100*X of mutable variables y> to implement the system (camera position, rotation, aceleration, ..., y> position and deformetion infomations for every object, ..., renderer y> situations [li

Re[2]: [Haskell-cafe] How to variables

2005-07-18 Thread Bulat Ziganshin
Hello robert, Monday, July 18, 2005, 10:14:43 PM, you wrote: rd> main = loop 0 0 0 -- initial values rd> where loop loop_num xpos ypos = rd> do e <- pollEvent rd> let xpos' = rd> ypos' = rd> someActionInvolvingPosition xpos' yp

RE: [Haskell-cafe] Strict and non-strict vs eager and lazy, was C onfused about Cyclic struture

2005-07-18 Thread Bernard Pope
On Mon, 2005-07-18 at 15:19 +0100, Bayley, Alistair wrote: > > From: Jerzy Karczmarczuk [mailto:[EMAIL PROTECTED] > > > > Bernard Pope wrote: > > > > >I'll be a little bit pedantic here. Haskell, the language definition, > > >does not prescribe lazy evaluation. It says that the language is > > >

[Haskell-cafe] Re: [Haskell] Re: A MonadPlusT with fair operations and pruning

2005-07-18 Thread oleg
Regarding the law of mif (aka ifte, aka soft-cut, aka logical conditional) mif (mif c t' e') t e = mif c (\x -> mif (t' x) t e) (mif e' t e) You're right of course: mode matters for the predicates that involve negation, such as mif. However, I believe that the mode is orthogonal to the disc

Re: [Haskell-cafe] How to variables

2005-07-18 Thread Claus Reinke
> >> I'm doing a 3D simulation. Now I need something like variables in > >> imperative languages. My mainLoop check for new events and renders > >> scene. > I saw it. The problem is, I need an amount of 100*X of mutable variables > to implement the system (camera position, rotation, aceleration, .

Re: [Haskell-cafe] How to variables

2005-07-18 Thread robert dockins
I'm doing a 3D simulation. Now I need something like variables in imperative languages. My mainLoop check for new events and renders scene. Then you want IORef. http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.IORef.html Consider, however, that this kind of construct can be do

[Haskell-cafe] How to variables

2005-07-18 Thread yin
Hello all! I'm doing a 3D simulation. Now I need something like variables in imperative languages. My mainLoop check for new events and renders scene. To use input for controling camera position I need variables. An equivalent code in C: void main_loop() { int loop_num = 0; bool run = 1

Re: [Haskell-cafe] How to variables

2005-07-18 Thread yin
robert dockins wrote: > > > yin wrote: > >> Hello all! >> >> I'm doing a 3D simulation. Now I need something like variables in >> imperative languages. My mainLoop check for new events and renders >> scene. > > > Then you want IORef. > http://www.haskell.org/ghc/docs/latest/html/libraries/base/Dat

Re: [Haskell-cafe] Re: Module.T naming style

2005-07-18 Thread Andrew Pimlott
On Mon, Jul 18, 2005 at 07:01:08PM +0200, Henning Thielemann wrote: > > On Fri, 15 Jul 2005, Andrew Pimlott wrote: > > > Even given an ideal implementation (I would add that it should allow > > multiple modules in one file), > > Why? Mere comfort, given my tools and habits. I sometimes want a

Re: [Haskell-cafe] How to variables

2005-07-18 Thread robert dockins
yin wrote: Hello all! I'm doing a 3D simulation. Now I need something like variables in imperative languages. My mainLoop check for new events and renders scene. To use input for controling camera position I need variables. An equivalent code in C: void main_loop() { int loop_num = 0;

Re: [Haskell-cafe] How to variables

2005-07-18 Thread robert dockins
I'm doing a 3D simulation. Now I need something like variables in imperative languages. My mainLoop check for new events and renders scene. Then you want IORef. http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.IORef.html I saw it. The problem is, I need an amount of 100*X of mu

Re: [Haskell-cafe] How to variables

2005-07-18 Thread robert dockins
Uhm... and what if I write some runtines in plain C, then bind them to Haskell and and use then as in OOP: [snip] Is this apoarch safe enougth, what do you think? If you do it carefully. But why? It sounds like you are planning to write a transliteration of the code you would write in

Re: [Haskell-cafe] How to variables

2005-07-18 Thread yin
robert dockins wrote: >> I'm doing a 3D simulation. Now I need something like variables in >> imperative languages. My mainLoop check for new events and renders >> scene. > > > Then you want IORef. > http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.IORef.

Re: [Haskell-cafe] How to variables

2005-07-18 Thread yin
robert dockins wrote: I'm doing a 3D simulation. Now I need something like variables in imperative languages. My mainLoop check for new events and renders scene. >>> >>> Then you want IORef. >>> http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.IORef.html >>> >> >> I s

Re: [Haskell-cafe] Re: Module.T naming style

2005-07-18 Thread Henning Thielemann
On Fri, 15 Jul 2005, John Meacham wrote: > I also make sure that the T is a type synonym for the actual name. as in > > module Vector where > > data Vector = ... > type T = Vector I had to use type synonymes sometimes to avoid mutually recursive modules. It has the disadvantage that a type synon

[Haskell-cafe] Re: Module.T naming style

2005-07-18 Thread Henning Thielemann
On Fri, 15 Jul 2005, Andrew Pimlott wrote: > Even given an ideal implementation (I would add that it should allow > multiple modules in one file), Why? > I don't find one type or class per module preferable. I think it's > usually a false division. It helped me to decide for divisions early.

Re: [Haskell-cafe] Haskell, SDL, OpenGL

2005-07-18 Thread yin
Lemmih wrote: >On 7/18/05, yin <[EMAIL PROTECTED]> wrote: > > >>Lemmih wrote: >> >> >> >>>On 7/18/05, yin <[EMAIL PROTECTED]> wrote: >>> >>> >>> >>> Hello, I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) and OpenGL bindings. When I try to compi

Re: [Haskell-cafe] Strict and non-strict vs eager and lazy

2005-07-18 Thread Malcolm Wallace
"Bayley, Alistair" <[EMAIL PROTECTED]> writes: > > > Lazy evaluation is an implementation technique which > > > satisfies non-strict semantics, but it is not the only > > > technique which does this. > > where can I find information about non-lazy implementation of non-strict > languages? Remem

Re: [Haskell-cafe] Haskell, SDL, OpenGL

2005-07-18 Thread Lemmih
On 7/18/05, yin <[EMAIL PROTECTED]> wrote: > Lemmih wrote: > > >On 7/18/05, yin <[EMAIL PROTECTED]> wrote: > > > > > >>Hello, > >> > >>I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) > >>and OpenGL bindings. When I try to compile my work, ghc runs collect2: > >> > >> > >>

Re: [Haskell-cafe] Haskell, SDL, OpenGL

2005-07-18 Thread yin
Lemmih wrote: >On 7/18/05, yin <[EMAIL PROTECTED]> wrote: > > >>Hello, >> >>I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) >>and OpenGL bindings. When I try to compile my work, ghc runs collect2: >> >> >> >>I just rerun collect2 by hand without pre /usr/lib paramete

Re: [Haskell-cafe] hawiki Haskell SDL openGl example works strange

2005-07-18 Thread Lemmih
On 7/18/05, yin <[EMAIL PROTECTED]> wrote: > Hello, again, > > I tried to run the example from http://haskell.org/hawiki/HaskellOpenGl > (the SDL version), but the scene is shown, only when I resize the > window. I tried to insert the drawGLScreen before mainloop call, but it > didn't worked. Do y

[Haskell-cafe] Re: hawiki Haskell SDL openGl example works strange

2005-07-18 Thread yin
yin wrote: >I tried to run the example from http://haskell.org/hawiki/HaskellOpenGl >(the SDL version), but the scene is shown, only when I resize the >window. I tried to insert the drawGLScreen before mainloop call, but it >didn't worked. Do you some idea how to resolve this little problem? > >

Re: [Haskell-cafe] Haskell, SDL, OpenGL

2005-07-18 Thread Lemmih
On 7/18/05, yin <[EMAIL PROTECTED]> wrote: > Hello, > > I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) > and OpenGL bindings. When I try to compile my work, ghc runs collect2: > > /usr/libexec/gcc/i686-pc-linux-gnu/3.4.3-20050110/collect2 > --eh-frame-hdr -m elf_i386 -dy

[Haskell-cafe] hawiki Haskell SDL openGl example works strange

2005-07-18 Thread yin
Hello, again, I tried to run the example from http://haskell.org/hawiki/HaskellOpenGl (the SDL version), but the scene is shown, only when I resize the window. I tried to insert the drawGLScreen before mainloop call, but it didn't worked. Do you some idea how to resolve this little problem? Thank

[Haskell-cafe] Haskell, SDL, OpenGL

2005-07-18 Thread yin
Hello, I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) and OpenGL bindings. When I try to compile my work, ghc runs collect2: /usr/libexec/gcc/i686-pc-linux-gnu/3.4.3-20050110/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o a.out -u GHCziBase_Izh

RE: [Haskell-cafe] Strict and non-strict vs eager and lazy, was C onfused about Cyclic struture

2005-07-18 Thread Bayley, Alistair
> From: Jerzy Karczmarczuk [mailto:[EMAIL PROTECTED] > > Bernard Pope wrote: > > >I'll be a little bit pedantic here. Haskell, the language definition, > >does not prescribe lazy evaluation. It says that the language is > >non-strict. Lazy evaluation is an implementation technique which > >satis

Re[2]: [Haskell-cafe] matrix computations based on the GSL

2005-07-18 Thread Henning Thielemann
On Mon, 18 Jul 2005, Bulat Ziganshin wrote: > GHC also have a RULES pragma which can be used to automatically > convert, for example, "mmap (*)" to "multipleElementWise". Nice idea! But how can GHC decide which optimization is better? M.map sin . M.map cos can be optimized to M.map (sin .

Re[2]: [Haskell-cafe] Re: Module.T naming style

2005-07-18 Thread Bulat Ziganshin
Hello Simon, Friday, July 15, 2005, 6:23:18 PM, you wrote: >> If you count writing a separate .hs-boot file as being the additional SM> It used to be Really Fun(TM) when GHC was built like this... you could SM> improve GHC's performance by simply typing 'make' a couple more times to SM> let the

Re[2]: [Haskell-cafe] matrix computations based on the GSL

2005-07-18 Thread Bulat Ziganshin
Hello Alberto, Wednesday, July 13, 2005, 8:13:48 PM, you wrote: >>If there are no efficiency concerns, I would drop element-wise operations >>and prefer a matrix-map and a matrix-zipWith. If these operations shall >>remain I would somehow point to their element-wise operation in the name. AR> Th

Re: [Haskell-cafe] IO Monad

2005-07-18 Thread Jens Fisseler
> Hi, > Could anyone explain for me why its not possible to return a primitive type > (such as Integer, String) while doing some IO actions ? > > e.g: foo :: IO() -> String > > What does it have to do with "lazy evalution" paradigm ? As there are people who can explain it better than me, just t

[Haskell-cafe] IO Monad

2005-07-18 Thread Dinh Tien Tuan Anh
Hi, Could anyone explain for me why its not possible to return a primitive type (such as Integer, String) while doing some IO actions ? e.g: foo :: IO() -> String What does it have to do with "lazy evalution" paradigm ? Cheers

Re: [Haskell-cafe] Re: Control.Monad.Cont fun

2005-07-18 Thread Magnus Carlsson
Tomasz Zielonka wrote: > On Fri, Jul 15, 2005 at 11:51:59PM +0200, Magnus Carlsson wrote: > >>A while ago, I attempted to marry value recursion a la Levent Erkök with >>the continuation-monad transformer. It seems possible if the underlying >>monad has value recursion and references. Interesting

Re: [Haskell-cafe] Re: Control.Monad.Cont fun

2005-07-18 Thread Magnus Carlsson
Hi Thomas and Tomasz, A late comment about a MonadFix instance for Cont/ContT: Thomas Jäger wrote: > Hello Tomasz, > > This stuff is very interesting! At first sight, your definition of > getCC seems quite odd, but it can in fact be derived from its > implementation in an untyped language. > >

RE: Unicode in GHC 6.2.2 and 6.4.x (was: Re: [Haskell-cafe] Unicode.hs)

2005-07-18 Thread Simon Marlow
On 17 July 2005 04:42, Dimitry Golubovsky wrote: > Dear List Subscribers, > > Simon Marlow wrote: >> On 30 June 2005 14:36, Dimitry Golubovsky wrote: >> >> >>> It is in CVS now, and I believe will be in 6.4.1 >> >> >> Not planned for 6.4.1, but definitely in 6.6. >> > > I have put those fil

RE: [Haskell-cafe] Re: Module.T naming style

2005-07-18 Thread Simon Marlow
On 15 July 2005 16:13, Malcolm Wallace wrote: >> Hand-writing .hi files is how GHC used to work (up to version 0.29, >> IIRC). It's not entirely satisfactory because you can get into >> situations where you have to 'make' several times to get to a fixed >> point, and you can construct examples th