[Haskell-cafe] some help on do and preservingMatrix
zsolt.ero at gmail.com
Thu Nov 26 14:55:44 EST 2009
Sorry to ask such a basic question here, but I am trying to write my
first Haskell OpenGL animation and just encontered with these
Could someone point me to some help on how does "do" work and how does
I am trying to write a program starting from the OpenGL tutorial on
the wiki, but I never used do's before.
My very basic question is that how do I generally repeat a command
many times? I understand "do" can do it, but it's not clear to me how
to use it and how it works.
So if I would like to write the following in one line, how could I write it?:
I don't understand in which cases I can use "map something
[0.7,0.8..1]" and in which cases I need do and how could I map using
>From the tutorial, I could write this line, which works, but I don't
really know what does mapM_ and preservingMatrix do.
mapM_ (\x -> preservingMatrix $ do
scale x x (1::GLfloat)
rotate (x*(200)) $ Vector3 0 0 (1::GLfloat)
) $ ([0.5,0.6..1::GLfloat])
More information about the Haskell-Cafe