Re: [Haskell-cafe] I need help getting started

2010-04-25 Thread John Bender
Mitchell You might also be interested in the beginners mailing list. I've been enjoying for about a month now! http://www.haskell.org/mailman/listinfo/beginners On Sat, Apr 24, 2010 at 9:57 PM, Luke Palmer lrpal...@gmail.com wrote: On Sat, Apr 24, 2010 at 10:34 PM, mitch...@kaplan2.com

[Haskell-cafe] Re: Announcement: Data.ISO3166_CountryCodes version 0.1

2010-04-25 Thread Jon Fairbairn
John Millikin jmilli...@gmail.com writes: Thanks for the library! I'm sure it will be very useful for people dealing with internationalized applications / libraries. I have a few suggestions, which might make your library easier to use and maintain. First, it's very common to include

Re: [Haskell-cafe] I need help getting started

2010-04-25 Thread Daniel Fischer
Am Sonntag 25 April 2010 06:34:32 schrieb mitch...@kaplan2.com: Luke already explained the type error, so I'll focus on the implementation. Hi, I'm just starting to learn, or trying to learn Haskell. I want to write a function to tell me if a number's prime. This is what I've got: f

[Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-04-25 Thread Heinrich Apfelmus
Luke Palmer wrote: The workhorse of our game has so far been generalized differentials. While not entirely rigorous, they have provided a very nice framework in which to express our thoughts and designs, and are very good at highly dynamic situations which appear in games. For example,

Re: [Haskell-cafe] London HUG domain expired

2010-04-25 Thread Yitzchak Gale
On Fri, Apr 23, 2010 at 1:24 PM, Bayley, Alistair wrote: Looks like the London HUG domain (londonhug.net) registration has expired. Neil Bartlett was the registrant. Neil: do you plan to renew? The whois database reports: Domain name: LONDONHUG.NET This domain name is up for auction for a

[Haskell-cafe] Cabal generating text files?

2010-04-25 Thread Michał J Gajda
Hi, Does anyone know how to generate a text file in a Cabal package? E.g. I want cabal to install a text file into $share_dir/applications/ app.desktop, and fill in certain fragments of this file with paths depending of the $share_dir variable. Say: ==Yi.desktop

[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

Re: [Haskell-cafe] Threads freezing

2010-04-25 Thread Roel van Dijk
The problem could be in your use of forkIO. To quote the documentation of forkOS [1]: Like forkIO, this sparks off a new thread to run the IO computation passed as the first argument, and returns the ThreadId of the newly created thread. However, forkOS creates a bound thread, which is

Re: [Haskell-cafe] Cabal generating text files?

2010-04-25 Thread Stephen Tetley
Hello Michał You should be able to run arbitrary code during build/installation by changing main in Setup.hs to use defaultMainWithHooks then supplying your own UserHooks main = defaultMainWithHooks my_hooks my_hooks :: UserHooks my_hooks = ... Best wishes Stephen

Re: [Haskell-cafe] Threads freezing

2010-04-25 Thread nccb2
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] singleton types

2010-04-25 Thread Günther Schmidt
Hello, HaskellDB makes extensive use of Singleton Types, both in its original version and the more recent one where it's using HList instead of the legacy implementation. I wonder if it is possible, not considering feasibility for the moment, to implement HaskellDB *without* using Singleton

Re: [Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-04-25 Thread Christopher Lane Hinson
1) In FRP, there is no global *type* GameState that stores the whole game state. Rather, the game state is implicit in the collection of active computations. This is also why state updating and drawing is woven together in FRP, which is good syntactically, but hard to disentangle for

Re: [Haskell-cafe] I need help getting started

2010-04-25 Thread David Anderson
On Sun, Apr 25, 2010 at 6:34 AM, mitch...@kaplan2.com wrote: Hi, I’m just starting to learn, or trying to learn Haskell.  I want to write a function to tell me if a number’s prime.  This is what I’ve got: f x n y = if n=y   then True   else   if gcd x n ==

[Haskell-cafe] Re: Confusions about the Haskell Platform (for Mac)

2010-04-25 Thread Gregory Collins
Yair Chuchem yair...@gmail.com writes: I don't have a good working solution for this, so the situation will have to remain status quo (i.e. clicking two installers) for now. afaik you can make an mpkg installer that invokes/contains other installers: see 

[Haskell-cafe] I need help getting started

2010-04-25 Thread mitchell
Hi Luke, Your fix worked. Thanks very much. I guess I thought that x was local to primeQ and when I called f, with y, it was just passing a value. As I was this response to you, I realized that I'm also passing x itself, oops. So I tried setting z=floor x, and passing z instead of x, and that

RE: [Haskell-cafe] I need help getting started

2010-04-25 Thread mitchell
John, Thanks, I didn't know it was there. I'll subscribe to it. Mitchell _ From: John Bender [mailto:john.m.ben...@gmail.com] Sent: Sunday, April 25, 2010 3:01 AM To: Luke Palmer Cc: mitch...@kaplan2.com; haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] I

RE: [Haskell-cafe] I need help getting started

2010-04-25 Thread mitchell
Hi Ivan, I have read through parts of the tutorials, and also purchased Real World Haskell - O'Reilly. It's not homework, if I were that young I might have more patience with my progress. Actually I going through the problems in ProjectEuler, and primarily using Mathematica. But it's slow. I

RE: [Haskell-cafe] I need help getting started

2010-04-25 Thread mitchell
Hi Daniel, I haven't yet absorbed everything you've written. One thing though, I didn't know how long division takes, but yeah, obviously gcd would take longer. Also when I put in the correction based on Luke's note, I found out about the perfect square problem. With regard to style, thanks

RE: [Haskell-cafe] I need help getting started

2010-04-25 Thread mitchell
Hi David, Thanks for the suggestion. I took a quick look at your article, and I'll have to spend a little more time on it. Delicious Primes? Great name. Also I appreciate your correct use of the phrase begging the question. The common and incorrect use that I hear constantly is one of my pet

Re: [Haskell-cafe] Threads freezing

2010-04-25 Thread Brandon S. Allbery KF8NH
On Apr 25, 2010, at 10:53 , nc...@kent.ac.uk wrote: Are you using the -threaded flag? This should be given to ghc when compiling, and I guess also to ghci when interpreting. A few more details IIRC ghci is always -threaded. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell]

Re: [Haskell-cafe] The instability of Haskell libraries

2010-04-25 Thread Henning Thielemann
John Goerzen schrieb: My second example was the addition of instances to time. My conclusion was: Never define orphan instances privately. If an instance cannot be added to the packages that provide the associated type or the class, then discuss the orphan instance with the maintainers of the

Re: [Haskell-cafe] I need help getting started

2010-04-25 Thread Daniel Fischer
Am Sonntag 25 April 2010 17:49:05 schrieb mitch...@kaplan2.com: Hi David, Thanks for the suggestion.  I took a quick look at your article, and I'll have to spend a little more time on it.  Delicious Primes?  Great name. And it's a good read. I find this definition of prime numbers

Re: [Haskell-cafe] Re: Announcement: Data.ISO3166_CountryCodes version 0.1

2010-04-25 Thread John Millikin
On Sun, Apr 25, 2010 at 01:08, Jon Fairbairn jon.fairba...@cl.cam.ac.uk wrote: John Millikin jmilli...@gmail.com writes: This allows users to install the package, without installing 3rd-party utilities, or downloading (possibly varying) versions from external websites. As your library is

[Haskell-cafe] Re: FGL up for adoption

2010-04-25 Thread Louis Wasserman
I'd be really interested; I have a lot of improvements I'd personally like to make. Louis Wasserman wasserman.lo...@gmail.com http://profiles.google.com/wasserman.louis ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-04-25 Thread Peter Verswyvelen
Actually, I believe that many Yampa examples do separate the drawing from the update... The arrow provides the game data that *can* be rendered. If you provide interpolators for that game data, you can still achieve the same as is explained in fix your timesteps (in my own FRP experiments I have

[Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-04-25 Thread Patai Gergely
(in my own FRP experiments I have an update thread and a render thread). I wonder how to nicely deal with state that requires communication with the outer world, even though it is functional at heart. For instance, if you want to change a vertex buffer or a texture or whatever during the update,

Re: [Haskell-cafe] The instability of Haskell libraries

2010-04-25 Thread Ivan Lazar Miljenovic
Henning Thielemann schlepp...@henning-thielemann.de writes: My conclusion was: Never define orphan instances privately. If an instance cannot be added to the packages that provide the associated type or the class, then discuss the orphan instance with the maintainers of the type and the class

Re: [Haskell-cafe] singleton types

2010-04-25 Thread Luke Palmer
2010/4/25 Günther Schmidt gue.schm...@web.de: Hello, HaskellDB makes extensive use of Singleton Types, both in its original version and the more recent one where it's using HList instead of the legacy implementation. I wonder if it is possible, not considering feasibility for the moment, to

Re: [Haskell-cafe] singleton types

2010-04-25 Thread Don Stewart
lrpalmer: 2010/4/25 Günther Schmidt gue.schm...@web.de: Hello, HaskellDB makes extensive use of Singleton Types, both in its original version and the more recent one where it's using HList instead of the legacy implementation. I wonder if it is possible, not considering feasibility

Re: [Haskell-cafe] singleton types

2010-04-25 Thread Günther Schmidt
Hello Luke, I mean something like data FirstName = FirstName data LastName = LastName data BirthDate = BirthDate ie. data FirstName data LastName data BirthDate In HaskellDB's case this is part of what's necessary to define individual columns. Another part is: instance FieldTag

Re: [Haskell-cafe] The instability of Haskell libraries

2010-04-25 Thread Henning Thielemann
Ivan Lazar Miljenovic schrieb: Henning Thielemann schlepp...@henning-thielemann.de writes: My conclusion was: Never define orphan instances privately. If an instance cannot be added to the packages that provide the associated type or the class, then discuss the orphan instance with the

Re: [Haskell-cafe] The instability of Haskell libraries

2010-04-25 Thread Ross Paterson
On Mon, Apr 26, 2010 at 06:47:27AM +1000, Ivan Lazar Miljenovic wrote: My main problem with this is if you want a custom variant of that instance. Let's take FGL graphs for example with instances for QuickCheck's Arbitrary class. Maybe you want arbitrary graphs that are simple, or maybe

Re: [Haskell-cafe] Proper Handling of Exceptional IEEE Floating Point Numbers

2010-04-25 Thread Richard O'Keefe
It seems to me that there's a choice here between (A) Full conformance to the letter of IEEE arithmetic AND full conformance to the letter of Haskell total ordering with consequent inconvenience: don't make floats Ord create new IEEE comparison operations for floats (B)

Re: [Haskell-cafe] Proper Handling of Exceptional IEEE Floating Point Numbers

2010-04-25 Thread Casey McCann
On Sun, Apr 25, 2010 at 9:08 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: It seems to me that there's a choice here between (...) Nice! That's a very comprehensive summary of the situation regarding issues of correctness. I do wonder, though, what (if any) are the performance implications?

[Haskell-cafe] What do _you_ want to see in FGL?

2010-04-25 Thread Ivan Lazar Miljenovic
Since I've volunteered myself to help maintain/upgrade FGL, what do the people in the community want to see happen with it? Here are some ideas that I have regarding FGL: * I had already started working on a new generic graph class [1] (with initial draft at [2]) to act as a wrapper around