[Haskell-cafe] 2D game graphics library for Haskell?

2007-08-24 Thread peterv
I’m currently playing around with SOE to make some simple interactive math exercises for students. This worked fine, although I could have done this much faster using C# (which I know very well), but since I’m addicted to Haskell now, I used the latter language ;) Furthermore, I hope that one day,

RE: [Haskell-cafe] Explaining monads

2007-08-13 Thread peterv
When I read "side-effects", I understand it as "unwanted effects", like "aliasing", and "effects depending on the order of execution". I'm not sure if my understanding here is correct. I hope Haskell does not allow "side-effects" but only "effects", meaning the monads do not allow you to write the

RE: [Haskell-cafe] a regressive view of support for imperative programming in Haskell

2007-08-08 Thread peterv
IMHO and being a newbie having 20 years of professional C/C++/C# experience but hardly any Haskell experience, I agree with this. I find the monad syntax very confusing, because it looks so much like imperative code, but it isn't. Personally I also liked the Concurrent Clean approach, although this

RE: [Haskell-cafe] Newbie question (again!) about phantom types

2007-08-08 Thread peterv
Thanks, that is a much clearer explanation than http://en.wikibooks.org/wiki/Haskell/Phantom_types Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Arie Peterson Sent: Wednesday, August 08, 2007 5:59 PM To: haskell-cafe@haskell.org Subject: Re: [Hask

[Haskell-cafe] Newbie question (again!) about phantom types

2007-08-08 Thread peterv
I’m having difficulty to understand what phantom types are good for. Is this just for improving runtime performance? I read the wiki, and it says "this is useful if you want to increase the type-safety of your code", but the code below does not give a compiler error for the function test1, I get

RE: [Haskell-cafe] Newbie question: "multi-methods" in Haskell

2007-08-06 Thread peterv
This is very nice, but it does not really solve the original problem. In your code, evaluating collide (Jupiter, Asteroid) will result in an endless loop. This is expected in your code, because no "inheritance" relation is present between e.g Jupiter and Planet. With multi-dispatch, it should pi

[Haskell-cafe] Newbie question: "multi-methods" in Haskell

2007-08-06 Thread peterv
In de book Modern C++ design, Andrei Alexandrescu writes that Haskell supports “multi-methods” http://books.google.com/books?id=aJ1av7UFBPwC&pg=PA3&ots=YPiJ_nWi6Y&dq=moder n+C%2B%2B&sig=FWO6SVfIrgtCWifj9yYHj3bnplQ#PPA263,M1 How is this actually done in Haskell? Maybe this is just a basic feature

RE: FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-02 Thread peterv
IMHO although this is a great explanation of what a monad is (as far as I understand it), for newbies I think it helps a lot to first look at the specific cases where monads are used and why they are invented, as explained in http://sigfpe.blogspot.com/2006/08/you-could-have-invented-monads-and.

FW: RE [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread peterv
Kaveh> "A monad is like a loop that can run a new function against its variable in each iteration." I’m an imperative programmer learning Haskell, so I’m a newbie, but I’ll give it a try ☺ Making mistakes is the best way to learn it ;) There are lots of different kinds of monads, but let’s sti

RE: [Haskell-cafe] Newbie question about automatic memoization

2007-07-31 Thread peterv
Thanks! Is this is also the case when using let and where, or is this just syntactic sugar? -Original Message- From: Jules Bean [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 31, 2007 5:09 PM To: Bryan Burgers Cc: peterv; haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Newbie

[Haskell-cafe] Newbie question about Haskell skills progress

2007-07-31 Thread peterv
Having only a couple of days of practice programming Haskell (but having read lots of books and docs), I find myself writing very explicit low level code using inner "aux" functions (accumulators and loops). Then I force myself to revise the code, replacing these aux functions with suitable higher

[Haskell-cafe] Newbie question about automatic memoization

2007-07-30 Thread peterv
Does Haskell support any form of automatic memorization? For example, does the function iterate f x which expands to [x, f(x), f(f(x)), f(f(f(x))), … gets slower and slower each iteration, or can it take advantage of the fact that f is referentially transparent and hence can be

RE: [Haskell-cafe] Looking for final year project - using Haskell, or another functional language

2007-07-13 Thread peterv
Yes, for a newbie like me it was actually the reason to abandon Haskell initially; none of the examples at http://www.haskell.org/HOpenGL compiled! Another very cool albeit difficult project would be automatic retargeting of Haskell code to the graphics processor unit (GPU), or IBM Synergistic Pro

RE: Re[2]: [Haskell-cafe] Newbie question about tuples

2007-07-13 Thread peterv
at Ziganshin [mailto:[EMAIL PROTECTED] Sent: Friday, July 13, 2007 6:43 PM To: peterv Cc: 'Lukas Mai'; haskell-cafe@haskell.org Subject: Re[2]: [Haskell-cafe] Newbie question about tuples Hello peterv, Friday, July 13, 2007, 5:03:00 PM, you wrote: > think the latest compilers are mu

RE: [Haskell-cafe] Re: Newbie question about tuples

2007-07-13 Thread peterv
Super. This is really a great mailing list :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chung-chieh Shan Sent: Friday, July 13, 2007 16:54 To: haskell-cafe@haskell.org Subject: [Haskell-cafe] Re: Newbie question about tuples peterv <[EM

RE: [Haskell-cafe] Newbie question about tuples

2007-07-13 Thread peterv
g problem says it's not *generally* possible? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Cast Sent: Friday, July 13, 2007 16:21 To: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Newbie question about tuples On Friday 13 July 2007, peterv w

RE: [Haskell-cafe] Newbie question about tuples

2007-07-13 Thread peterv
I'm beginning to see that my old implementation in C++ clutters my Haskell design. You see, in C++ I can write: // A vector is an array of fixed-length N and elements of type T template struct Vector { T Element[N]; friend T dot(const Vector& a, const Vector& b) { T result = 0;

RE: [Haskell-cafe] Haskell & monads for newbies (was "Functional dependencies *not* part of the next Haskell standard?")

2007-07-12 Thread peterv
zzy talk from a newbie trying to look impressive ;) -Original Message- From: Benja Fallenstein [mailto:[EMAIL PROTECTED] Sent: Thursday, July 12, 2007 3:11 PM To: peterv Cc: Henning Thielemann; Haskell-Cafe@haskell.org Subject: Re: [Haskell-cafe] Functional dependencies *not* part of the n

RE: [Haskell-cafe] Functional dependencies *not* part of the next Haskell standard?

2007-07-12 Thread peterv
g these funcdeps, are they "ill" as the "rumor" goes? Thanks, Peter -Original Message- From: Henning Thielemann [mailto:[EMAIL PROTECTED] Sent: Thursday, July 12, 2007 11:44 AM To: peterv Cc: Haskell-Cafe@haskell.org Subject: Re: [Haskell-cafe] Functional depende

[Haskell-cafe] Functional dependencies *not* part of the next Haskell standard?

2007-07-12 Thread peterv
I tried to do something in CAL that I could not solve without functional dependencies. In their support forum, it got mentioned that func.deps propably won't make into the next Haskell standard... Any comments on that? Now, the thing I tried to solve was: data Vector2 a = Num a => V2 a a

[Haskell-cafe] Newbie question about tuples

2007-07-12 Thread peterv
Hi, I have a couple of questions about tuples. Q1) Is it possible to treat a tuple of N elements in a generic way? So instead of writing functions like lift1 e1, lift2 (e1,e2), lift3 (e1,e2,e3) just one function liftN that works on tuples of any length? Q2) (Maybe related to Q1) Can I convert a

RE: [Haskell-cafe] RE: Modern Haskell books (was "Re: A very nontrivial parser")

2007-07-06 Thread peterv
riginal Message- From: Donald Bruce Stewart [mailto:[EMAIL PROTECTED] Sent: Friday, July 06, 2007 11:22 To: peterv Cc: 'Bulat Ziganshin'; haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] RE: Modern Haskell books (was "Re: A very nontrivial parser") dons: > bf3: > &

[Haskell-cafe] RE: Modern Haskell books (was "Re: A very nontrivial parser")

2007-07-06 Thread peterv
> but afair you don't yet have too much experience even with H98 > language? from my POV, H98 as is useful for learning, but not for real > apps. there is wide common subset of GHC and Hugs language extensions > and this set (with exception for FD) will probably become new Haskell' > standard The

[Haskell-cafe] Haskell's "currying" versus Business Objects Gem Cutter's "burning"

2007-07-03 Thread peterv
In Haskell, currying can only be done on the last (rightmost) function arguments. So foo x y can be curried as foo x but not as foo ? y where ? would be a "wilcard" for the x parameter. In Haskell, one must write a new function foo2 y x = foo x y and then

[Haskell-cafe] HGL on Windows

2007-06-29 Thread peterv
I vaguely remember to have read that HGL is (currently) not supported on Windows, but I can't find this information any more. Is this correct? It seems not to be included in GHC 6.6 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

RE: [Haskell-cafe] Newbie question: alternative for toInt/fromInt

2007-06-29 Thread peterv
quot; magic worked fine, thanks! -Original Message- From: Thomas Schilling [mailto:[EMAIL PROTECTED] Sent: Thursday, June 28, 2007 9:40 PM To: peterv Cc: Haskell-Cafe@haskell.org Subject: Re: [Haskell-cafe] Newbie question: alternative for toInt/fromInt toInt = id fromInt = id ? On 28

[Haskell-cafe] Newbie question: alternative for toInt/fromInt

2007-06-28 Thread peterv
I'm trying to get the SOE graphics library to compile for Win32 using the latest libraries. I fixed a couple of imports, but in the file GraphicsTypes.hs, the functions toInt/fromInt are used, which are now obsolete: type Dimension = Int toDimension:: Win32.INT -> Dimension fromDimens

RE: [Haskell-cafe] New New newbie question/help

2007-06-27 Thread peterv
; a -> b With your encouragements, I'll keep pluuging. Thanks. - br On 6/27/07, peterv <[EMAIL PROTECTED]> wrote: I'm also a haskell newbie, but I'll try to help; the experts here will correct me if I'm wrong. The compiler cannot in all cases infer the type of a numbe

RE: [Haskell-cafe] New New newbie question/help

2007-06-27 Thread peterv
I'm also a haskell newbie, but I'll try to help; the experts here will correct me if I'm wrong. The compiler cannot in all cases infer the type of a number. pi can be a Float, a Double, or even a complex number. Furthermore unlike in C/C++ you cannot just mix integer and floating operations. Fo

RE: [Haskell-cafe] Practical Haskell question.

2007-06-25 Thread peterv
I'm baffled. So using the Arrow abstraction (which I don't know yet) would solve this problem? How can (perfectActionB x) be checked with without ever executing performActionA which evaluates to x? This can only be done when x is a constant expression no? -Original Message- From: [EMAIL PR

RE: [Haskell-cafe] "Graphical Haskell"

2007-06-22 Thread peterv
Wow thanks for all the info! This certainly can get me started. And yet I have some more questions (sorry!): - Unfortunately this project won't be open source; if my first tests are successful, I will try to convince my employer (who wants to develop such a graphical language) to use Haskell for

RE: [Haskell-cafe] "Graphical Haskell"

2007-06-22 Thread peterv
Hi, Since nobody gave an answer on this topic, I guess it is insane to do it in Haskell (at least for a newbie)? :) Thanks for any info, Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of peterv Sent: Wednesday, June 20, 2007 21:48 To: haskell-cafe

RE: [Haskell-cafe] Haskell version of ray tracer code is much slower than the original ML

2007-06-21 Thread peterv
So float math in *slower* than double math in Haskell? That is interesting. Why is that? BTW, does Haskell support 80-bit "long double"s? The Intel CPU seems to use that format internally. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philip Armstro

[Haskell-cafe] "Graphical Haskell"

2007-06-20 Thread peterv
In the book "Haskell School of Expression", streams are nicely explained using a graphical flow graph. This is also done more or less in http://research.microsoft.com/~simonpj/papers/marktoberdorf/Marktoberdorf.pp t to explain monads and other concepts. I would like to create a program that allow

RE: [Haskell-cafe] Haskell mode for emacs - some questions

2007-06-20 Thread peterv
at trying to make the SOE stuff work with the threaded runtime system by using the primitives Gtk2Hs provides to use Gtk+ safely from multiple threads. Duncan" -Original Message- From: David House [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 20, 2007 6:42 PM To: peterv Cc: 'D

RE: [Haskell-cafe] Useful IDE features -

2007-06-20 Thread peterv
> (which just states that record type and field label type together uniquely determine the field value type) That's nice. When will a new Haskell standard become official? It seems so many new extensions exist, that one cannot judge the language by looking at "Haskell98" anymore. > in practice, o

RE: [Haskell-cafe] Avoiding "Non-exhaustive patterns in function f"

2007-06-20 Thread peterv
Super! Would be nice if this gets build into GHC/GHCI :) -Original Message- From: Neil Mitchell [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 20, 2007 01:07 To: Felipe Almeida Lessa Cc: peterv; haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Avoiding "Non-exhaustive patter

RE: [Haskell-cafe] Re: Haskell mode for emacs - some questions

2007-06-20 Thread peterv
> Sounds like it was difficult. Could you describe what you tried Actually, it was easy once I switched from xemacs to emacs... Of course, I missed the part in the wiki that xemacs does not work without some changes, mea culpa. The reason I used xemacs was because the previous version of emacs

RE: [Haskell-cafe] Haskell mode for emacs - some questions

2007-06-20 Thread peterv
ssage- From: Jules Bean [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 19, 2007 09:58 To: peterv Cc: 'David House'; haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Haskell mode for emacs - some questions peterv wrote: > And when I will me using HopenGL, I will want perform

[Haskell-cafe] Avoiding "Non-exhaustive patterns in function f"

2007-06-19 Thread peterv
Haskell is known for its very strong static type checking, which eliminates a lot of runtime errors. But the following simple program crashes at runtime: data D = A | B f A = True main = print (f B) I understand this has nothing to do with type checking, but why can't the compiler giv

RE: [Haskell-cafe] Haskell mode for emacs - some questions

2007-06-19 Thread peterv
mming videogames or special effects, you have to run and test a lot, because what you see on screen usually determines your next actions. -Original Message- From: David House [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 19, 2007 12:34 AM To: peterv Cc: haskell-cafe@haskell.org Subjec

RE: Re[2]: [Haskell-cafe] Useful IDE features - "implement instance"

2007-06-19 Thread peterv
ion, which is a pain (forgive me if I'm using incorrect terms here, I come from the OO world...) Personally I like that, but that's a question of taste I guess. Peter -Original Message- From: Bulat Ziganshin [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 19, 2007 8:39 AM To: pete

[Haskell-cafe] Haskell mode for emacs - some questions

2007-06-18 Thread peterv
I finally got emacs using Haskell-mode working. It seems that the latest version of emacs support nice font smoothing on Windows; the last time I looked it didn't. Auto indent works, inf-haskell works, really great. So far so good. But I have some questions I did not find in the wiki: - How can I

RE: [Haskell-cafe] Useful IDE features - "implement instance"

2007-06-18 Thread peterv
That looks cool. Just another wild idea which I might find useful, but is more like refactoring, is to convert the fields of a record to get/set type-classes, and refactor all usages of those fields. So --- data Person = Person { name :: String, age :: Float } main = print $ na

RE: [Haskell-cafe] Useful IDE features - Accessibility considerations

2007-06-18 Thread peterv
Well, yes and no. Such an IDE does not have to follow the guidelines, because as you said, these are “flexible”. Take Microsoft Office 2007, completely new GUI, shocked the world. But take Eclipse. This is a fairly standard GUI, mostly the same on unix, mac, and Windows. IMHO, for a

RE: Re[2]: [Haskell-cafe] IDE?

2007-06-18 Thread peterv
Well, if I was 15 again and had no RSI in both arms, I certainly would create a basic IDE as my first Haskell project, it would be fun ;) I've looked at the code of Visual Haskell, but I'm not (yet/ever?) capable of enhancing it (the Haskell part, the COM/C++ part is a lot easier for me). So it's a

RE: [Haskell-cafe] IDE? (and WHY I'm looking at Haskell)

2007-06-18 Thread peterv
Thanks for the nice info. I'm going to give it another try then... When I said I don't want to learn Emacs, I meant not learning its LISP architecture with the goal of creating my own custom Emacs... OT: The reasons I'm looking at Haskell are: - the object oriented approach failed for me when w

RE: [Haskell-cafe] Useful IDE features - "implement instance"

2007-06-18 Thread peterv
Another feature which would be cool for an IDE is: "implement instance". So you automatically get to see all the functions of a type class you need to implement. Using C#/Java, this is used all over the place. No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5

RE: [Haskell-cafe] IDE?

2007-06-17 Thread peterv
I just tried the Haskell Mode using xemacs, adjust my init.el file, loaded my haskell file, and got great syntax highlighting! So far so good. But people, emacs is so weird for a Windows user... For example, ALL windows (and motif?) programs use CTRL-Z for undo. But not emacs... So after som

RE: Re[2]: [Haskell-cafe] IDE?

2007-06-16 Thread PeterV
Indeed, that's what I forgot to mention, Resharper in Visual Studio 2005 does that for C#, IntelliJ & Eclipse for Java. You rarely need compilation, its syntax checker runs inplace and incrementally and shows you the errors and warning in the right margin. That saves you a lot of time. For Haskel

RE: [Haskell-cafe] IDE?

2007-06-15 Thread PeterV
Thank for the reply. I'll try the emacs approach (or better Xemacs because Emacs on Windows has really ugly font smoothing), but I must say that - being an old school object-oriented programmer who got spoiled by fully integrated IDEs like Borland's TurboPascal, Microsoft Visual Studio, and Eclip