[Haskell-cafe] Those damned parentheses

2011-05-07 Thread Eitan Goldshtrom
Hi. I am kind of tired of all of the parentheses I have to put in places and I'm trying to figure out what is the correct way to write code such that I can leave out parentheses. For example, I have the following: data Message = ... --leaving this out because it's not important data Plane =

Re: [Haskell-cafe] Those damned parentheses

2011-05-07 Thread Eitan Goldshtrom
I know about the $ symbol, that's why it's in there in the respective places. I see that I can use it to fix my problem, but I was trying to figure out function composition really. I guess that's just not the place for it. I'll check out Control.Applicative. Also thanks for the clarification

[Haskell-cafe] Documentation for OpenGL?

2010-08-13 Thread Eitan Goldshtrom
Hi everyone. I'm looking for something specific. I'm trying to figure out how to use the depthFunc StateVar and I can't find any official documentation for it. I did a :t depthFunc in ghci and got depthFunc :: StateVar (Maybe ComparisonFunction) so I looked up ComparisonFunction and couldn't

[Haskell-cafe] Re: Documentation for OpenGL?

2010-08-13 Thread Eitan Goldshtrom
Woops, nevermind. I WAS looking in the wrong place. I should've known =P. Sorry for the unnecessary request. -Eitan PS. For anyone interested all of the documentation is in Graphics.Rendering.OpenGL.GL.PerFragment on hackage ___ Haskell-Cafe mailing

[Haskell-cafe] Compiled OpenGL program has DOS window?

2010-08-13 Thread Eitan Goldshtrom
Hi. I'm working in Windows on an OpenGL application. I finally got everything working, doing all of my testing through the interpreter. When I finally compiled and ran the program from an executable for the first time I noticed that before creating my OpenGL window an empty DOS prompt popped

[Haskell-cafe] How do you change the mouse position?

2010-08-12 Thread Eitan Goldshtrom
In C++, maybe Java, I remember using a Robot to change the location of the mouse on the screen. My intention is to do something like in an FPS game where the mouse is always centered to make sure it doesn't run into the edges of the screen. How can I do that in Haskell? I'm using OpenGL, so if

Re: [Haskell-cafe] How do you change the mouse position?

2010-08-12 Thread Eitan Goldshtrom
Thanks. That is exactly what I was looking for. I really appreciate the help. -Eitan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Fail to install SDL with Cabal

2010-07-30 Thread Eitan Goldshtrom
I'm trying to install SDL through Cabal -- I don't know another way to install it. However, I'm getting this: setup.exe: The package has a './configure' script. This requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. cabal: Error: some packages failed to install: SDL-0.5.10

Re: [Haskell-cafe] OpenGL Speed!

2010-07-30 Thread Eitan Goldshtrom
HGL actually looks like EXACTLY what I need. I only need to set pixels, which looks like just what HGL would be good at. Only problem is that I can't find a single tutorial for HGL. Does anyone know or any, or where I could find one? -Eitan On 7/30/2010 12:22 PM, Henning Thielemann wrote:

[Haskell-cafe] OpenGL Speed!

2010-07-29 Thread Eitan Goldshtrom
I'm having an unusual problem with OpenGL. To be honest I probably shouldn't be using OpenGL for this, as I'm just doing 2D and only drawing Points, but I don't know about any other display packages, so I'm making due. If this is a problem because of OpenGL however, then I'll have to learn

[Haskell-cafe] Memory and Threads - MVars or TVars

2010-07-28 Thread Eitan Goldshtrom
Hi everyone. I was wondering if someone could just guide me toward some good information, but if anyone wants to help with a personal explanation I welcome it. I'm trying to write a threaded program and I'm not sure how to manage my memory. I read up on MVars and they make a lot of sense. My

Re: [Haskell-cafe] Re: Memory and Threads - MVars or TVars

2010-07-28 Thread Eitan Goldshtrom
this approach is pretty much like not having to worry about garbage collection. Even using STM you still have to do a lot of your own manual forkIO, putVar, kill etc. Best regards Günther Am 29.07.10 02:23, schrieb Eitan Goldshtrom: Hi everyone. I was wondering if someone could just guide me

Re: [Haskell-cafe] Memory and Threads - MVars or TVars

2010-07-28 Thread Eitan Goldshtrom
Ah! That clears that up a lot. I read the wiki page but something just didn't make full sense about it until you used the word prevent. I understand that the computer doesn't actually prevent other threads from running -- that would defeat the purpose of the concurrency -- but it helped clear

[Haskell-cafe] The where-clause and guards

2010-07-21 Thread Eitan Goldshtrom
I'm trying to fit a where clause to some guards I'm using. I have the following f a b | c 1 = ... | c 1 = ... | otherwise = ... where c = a+b yet I'm getting a parsing error. Is this not the correct way to combine where with guards? -Eitan

Re: [Haskell-cafe] The where-clause and guards

2010-07-21 Thread Eitan Goldshtrom
Well, perhaps you can help me figure out the problem with my exact program. Just in case it matters, the program draws a Mandelbox via volumetric ray casting. I can provide more information about the function, but I wouldn't think it's necessary, since my problem is with parsing. The error I'm

Re: [Haskell-cafe] The where-clause and guards

2010-07-21 Thread Eitan Goldshtrom
Aha. I understand now. A single where-clause applies to the entire scope of the function, at all levels. Thanks for the help. -Eitan On 7/21/2010 3:55 AM, Nicolas Wu wrote: Ugh, my formatting got eaten up by gmail. I just removed the where in front of m =, and aligned tat statment with your

Re: [Haskell-cafe] How do you make constant expressions?

2010-07-19 Thread Eitan Goldshtrom
One point of clarification that'd be nice. I'm getting some type errors that I wasn't getting before, so I'd just like to know something about the inline pragma. I have width = 800 {-# INLINE width #-} main = (truncate width, fromIntegral width) Now when I ran this program it seemed to work

Re: [Haskell-cafe] How do you make constant expressions?

2010-07-19 Thread Eitan Goldshtrom
Correction to my last e-mail. I figured out why it worked at first and then failed, so I'll refine my question. I'd like the compiler to simply put the number 800 everywhere that I put the name width in my code. Instead it's putting (800 :: Float), or Double or Int, whatever I want, but it's

Re: [Haskell-cafe] How do you make constant expressions?

2010-07-19 Thread Eitan Goldshtrom
Awesome. It worked. Haskell continues to impress me. Thanks for the help everyone. -Eitan On 7/19/2010 4:42 AM, Max Bolingbroke wrote: Use NoMonomorphismRestriction or give an explicit type signature: width :: Num a = a width = 800 Max ___

[Haskell-cafe] How do you make constant expressions?

2010-07-18 Thread Eitan Goldshtrom
Silly question, but I can't find the answer on the net. I think I'm just using the wrong words in my search. I'm looking for a way to create constant expressions in Haskell. The C/C++ equivalent of what I'm talking about is #define NAME VALUE I want an expression, or really just numbers for

Re: [Haskell-cafe] How do you make constant expressions?

2010-07-18 Thread Eitan Goldshtrom
So just so I get this straight, the following are equivalent to the computer, after compiling: 1. fact = 10 {-# INLINE fact #-} func x = x * fact 2. func x = x * 10 I'm also curious as to what the {-# #-} brackets represent. I've never seen those before. -Eitan

Re: [Haskell-cafe] Devices and Webcams, The Basics

2010-05-20 Thread Eitan Goldshtrom
On Wed, May 19, 2010 at 10:06 PM, Eitan Goldshtrom thesource...@gmail.com wrote: Hi everyone, I would like to start working on a program that requires access to a camera attached to the computer probably via USB or otherwise internally. Unfortunately I don't know anything about using devices

[Haskell-cafe] Devices and Webcams, The Basics

2010-05-19 Thread Eitan Goldshtrom
Hi everyone, I would like to start working on a program that requires access to a camera attached to the computer probably via USB or otherwise internally. Unfortunately I don't know anything about using devices in haskell. I tried looking up how to access the microphone one too and had

[Haskell-cafe] Threads freezing

2010-04-25 Thread Eitan Goldshtrom
Hello fellow Haskell programmers, I seem to be having problems with some threads of mine. I wrote an OpenGL program that employs some threads (forkIO) in order to separate any calculations from the OpenGL code. At first it all seemed to be working just fine. Then I added some code for

[Haskell-cafe] Search a directory for files

2009-12-19 Thread Eitan Goldshtrom
Hi, I'm trying to make a program to make it easy to rename files in bulk. What I'm wondering is how to get a list of all files in a particular directory. I found System.Posix.Files and I'm planning on using the rename function in it for actually renaming, but I can't find an easy way to get

Re: [Haskell-cafe] Search a directory for files

2009-12-19 Thread Eitan Goldshtrom
convenient functionality for finding all files which match a particular pattern. Cheers, Greg On Dec 19, 2009, at 6:40 PM, Eitan Goldshtrom wrote: Hi, I'm trying to make a program to make it easy to rename files in bulk. What I'm wondering is how to get a list of all files in a particular

[Haskell-cafe] HOpenGL and freeglut rendering problems

2009-11-24 Thread Eitan Goldshtrom
Hello. I'm new to this mailing list, so I apologize if this question is inappropriate for this list, but I've been looking for a solution to this problem for weeks and I've had no luck. I am trying to write a program with HOpenGL and freeglut, but I can't seem to get it to render. I'm running