Re: [Haskell-cafe] Optional EOF in Parsec.

2009-04-03 Thread Antoine Latter
On Fri, Apr 3, 2009 at 8:17 PM, Kannan Goundan wrote: > > I'm writing a parser with Parsec.  In the input language, elements of a > sequence > are separated by commas: > >   [1, 2, 3] > > However, instead of a comma, you can also use an EOL: > >  [1, 2 >  3] > > Anywhere else, EOL is considered i

Re: [Haskell-cafe] Generating functions for games

2009-04-03 Thread andy morris
2009/4/4 : > So some time ago I saw mentioned the game of Zendo > https://secure.wikimedia.org/wikipedia/en/wiki/Zendo_(game) as a good game > for programmers to play (and not just by Okasaki). The basic idea of Zendo > is that another player is creating arrangements of little colored plastic > sh

[Haskell-cafe] Generating functions for games

2009-04-03 Thread gwern0
So some time ago I saw mentioned the game of Zendo https://secure.wikimedia.org/wikipedia/en/wiki/Zendo_(game) as a good game for programmers to play (and not just by Okasaki). The basic idea of Zendo is that another player is creating arrangements of little colored plastic shapes and you have

[Haskell-cafe] Optional EOF in Parsec.

2009-04-03 Thread Kannan Goundan
I'm writing a parser with Parsec. In the input language, elements of a sequence are separated by commas: [1, 2, 3] However, instead of a comma, you can also use an EOL: [1, 2 3] Anywhere else, EOL is considered ignorable whitespace. So it's not as simple as just making EOL a token and

Re: [Haskell-cafe] ANN: logfloat 0.12.0.1

2009-04-03 Thread Robert Greayer
wren ng thornton wrote: > Using the FFI complicates the build process for Hugs; details are noted in > the INSTALL file. It may also complicate building on Windows (due to ccall vs > stdcall), > though I'm not familiar with Windows FFI and don't have a machine > to test on. On XP with GHC 6.10

[Haskell-cafe] ANN: logfloat 0.12.0.1

2009-04-03 Thread wren ng thornton
-- logfloat 0.12.0.1 This package provides a type for storing numbers in the log-domain, primarily useful for preventing underflow when multiplying many probabilities as in HMMs and other probabilistic mod

Re: [Haskell-cafe] Possible floating point bug in GHC?

2009-04-03 Thread Peter Verswyvelen
Okay, I can confirm the bug is fixed. It's insane this bug did not cause any more problems. Every call into every C function that uses floating point could have been affected (OpenGL, BLAS, etc) On Fri, Apr 3, 2009 at 10:47 PM, Peter Verswyvelen wrote: > Ouch, what a waste of time on my side :-(

Re: [Haskell-cafe] Possible floating point bug in GHC?

2009-04-03 Thread Peter Verswyvelen
Ouch, what a waste of time on my side :-( This bugfix is not mentioned in the "notable bug fixes" here Since this is such a severe bug, I would recommend listing it :) Anyway, I have a very small repro test case now. Will c

Re: [Haskell-cafe] Possible floating point bug in GHC?

2009-04-03 Thread Ian Lynagh
On Fri, Apr 03, 2009 at 10:10:17PM +0200, Peter Verswyvelen wrote: > I tried both precise and fast, but that did not help. Compiling to SSE2 > fixed it, since that does not use a floating point stack I guess. You didn't say what version of GHC you are using, but it sounds like this might already b

Re: [Haskell-cafe] Possible floating point bug in GHC?

2009-04-03 Thread Peter Verswyvelen
I tried both precise and fast, but that did not help. Compiling to SSE2 fixed it, since that does not use a floating point stack I guess. I'm preparing a repro test case, but it is tricky since removing code tends to change the optimizations and then the bug does not occur. Does anybody know what

Re: [Haskell-cafe] Possible floating point bug in GHC?

2009-04-03 Thread Zachary Turner
What floating point model is your DLL compiled with? There are a variety of different options here with regards to optimizations, and I don't know about the specific assembly that each option produces, but I know there are options like Strict, Fast, or Precise, and maybe when you do something like

Re: [Haskell-cafe] Possible floating point bug in GHC?

2009-04-03 Thread Peter Verswyvelen
Well this situation can indeed not occur on PowerPCs since these CPUs just have floating point registers, not some weird dual stack sometimes / registers sometimes architecture. But in my case the bug is consistent, not from time to time. So I'll try to reduce this to a small reproducible test cas

Re: [Haskell-cafe] Problem with prepose.lhs and ghc6.10.1

2009-04-03 Thread Edward Kmett
With the changes to ScopedTypeVariables in GHC you can't pick up the type from the return type of your function directly, so you'll need either a combinator to do the work or to pass the type in question in as an argument to a helper function. normalize :: (Modular s a, Integral a) => a -> (M s a)

Re: [Haskell-cafe] Possible floating point bug in GHC?

2009-04-03 Thread Malcolm Wallace
Interesting. This could be the cause of a weird floating point bug that has been showing up in the ghc testsuite recently, specifically affecting MacOS/Intel (but not MacOS/ppc). http://darcs.haskell.org/testsuite/tests/ghc-regress/lib/Numeric/num009.hs That test compares the result of t

Re: [Haskell-cafe] Announcement: Beta of Leksah IDE available

2009-04-03 Thread John Van Enk
What's the chance things like hsc2hs and c2hs will ever be supported? :) I'm aware this is a horribly difficult task (or I think it is). Perhaps it would be possible to find the .hsc and .chs files and run the corresponding processor over them and extract data/types/functions from the correspondin

Re: [Haskell-cafe] Monad transformer, liftIO

2009-04-03 Thread Michael Roth
Creighton Hogg schrieb: > Okay, so I think what you want is > > [...] Yes. Your solution works. Thank you. But: > a <- msum . map return $ [1,2,3] Why Do I need this "msum . map return" thing? The "map return" part is somewhat clear. But not entirely. Which type of monad is created here? T

[Haskell-cafe] Possible floating point bug in GHC?

2009-04-03 Thread Peter Verswyvelen
For days I'm fighting against a weird bug. My Haskell code calls into a C function residing in a DLL (I'm on Windows, the DLL is generated using Visual Studio). This C function computes a floating point expression. However, the floating point result is incorrect. I think I found the source of the

[Haskell-cafe] A fair number of updates to Buster since the other day - 0.99.5

2009-04-03 Thread Jeff Heard
http://vis.renci.org/jeff/2009/04/03/major-updates-to-buster/ Added several new widgets and several new behaviours related to file reading and writing, exceptions, and the system/program environment. -- Jeff ___ Haskell-Cafe mailing list Haskell-Cafe@ha

[Haskell-cafe] ANNOUNCE hgettext-0.1.5 - GetText based internationalization of Haskell programs

2009-04-03 Thread Vasyl Pasternak
Hello, I have extended my previous version of the library to support distribution and installation of PO files. Source tarball - http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hgettext Also I described how to use this feature to distribute haskell packages in my blog entry http://prog

Re: [Haskell-cafe] Monad transformer, liftIO

2009-04-03 Thread Creighton Hogg
On Fri, Apr 3, 2009 at 11:49 AM, Michael Roth wrote: > Hello list, > > maybe I'm just stupid, I'm trying to do something like this: > > >        import Control.Monad >        import Control.Monad.Trans >        import Control.Monad.List > >        foobar = do >                a <- [1,2,3] >      

Re: [Haskell-cafe] Monad transformer, liftIO

2009-04-03 Thread Andrew Wagner
You haven't really said what happens when you try this, but I would bet that things would be clarified greatly if you put type signatures on your two definitions. On Fri, Apr 3, 2009 at 12:49 PM, Michael Roth wrote: > Hello list, > > maybe I'm just stupid, I'm trying to do something like this: >

[Haskell-cafe] Monad transformer, liftIO

2009-04-03 Thread Michael Roth
Hello list, maybe I'm just stupid, I'm trying to do something like this: import Control.Monad import Control.Monad.Trans import Control.Monad.List foobar = do a <- [1,2,3] b <- [4,5,6] liftIO $ putStrLn $ (show a) +

Re: [Haskell-cafe] Announcement: Beta of Leksah IDE available

2009-04-03 Thread jutaro
Hello Jeff, I'm not so shure if I understand what you mean (and I'm off for vacations in a few minute). So lets find out later. But you may try to set the --user to your config flags in menu: Packages/Edit Flags. Jürgen Jeff Heard wrote: > > Jurgen... I have one more question, or rather requ

Re: [Haskell-cafe] Announcement: Beta of Leksah IDE available

2009-04-03 Thread Jeff Heard
Jurgen... I have one more question, or rather request... I'm running under Ubuntu, and I get inconsistencies with packages that I build and install via Leksah not showing up when I configure other packages that depend on them. Then I notice that you're using runhaskell Setup.lhs ... to configure

Re: [Haskell-cafe] ANNOUNCE: fad 1.0 -- Forward Automatic Differentiation library

2009-04-03 Thread Edward Kmett
A somewhat tricky concern is that that the extra functionality in question depends on a bunch of primitive definitions that lie below this in the package and the AD engine is used by a layer on top. So moving it out would introduce a circular dependency back into the package or require me to strat

Re: [Haskell-cafe] ANNOUNCE: fad 1.0 -- Forward Automatic Differentiation library

2009-04-03 Thread Edward Kmett
Very nice to have! FYI- there is at least one more quantification-based automatic differentiation implementation in Hackage: http://comonad.com/haskell/monoids/dist/doc/html/monoids/Data-Ring-Module-AutomaticDifferentiation.html My implementation is/was focused upon use with monoids and other mo

Re: [Haskell-cafe] Re: Reverting to any old version using Darcs

2009-04-03 Thread Peter Verswyvelen
Okay. I always put these in the boring file. Matter of taste I guess. On Fri, Apr 3, 2009 at 3:18 PM, Ketil Malde wrote: > Peter Verswyvelen writes: > > > Regarding these files that people forget to checkin. > > Doesn't every project have a well define directory structure? Shouldn't > the > > "p

Re: [Haskell-cafe] List and description of language extensions

2009-04-03 Thread Sean Leather
> It's been multiple times now that I've been confounded by something in >> Haskell which was then solved by a language extension (first >> FunctionalDependencies, most recently ScopedTypeVariables). I'm wondering if >> there is a list anywhere of all the language extensions supported by GHC and >>

Re: [Haskell-cafe] Re: Reverting to any old version using Darcs

2009-04-03 Thread Ketil Malde
Peter Verswyvelen writes: > Regarding these files that people forget to checkin. > Doesn't every project have a well define directory structure? Shouldn't the > "prefs/boring" file use this fact to encapsulate the rules of file inclusion > and exclusion? Isn't it safer to checkin too many files (

Re: [Haskell-cafe] Program using 500MB RAM to process 5MB file

2009-04-03 Thread lucas
On Fri, Apr 03, 2009 at 10:27:08PM +1100, lu...@die.net.au wrote: > On Fri, Apr 03, 2009 at 10:22:07AM +0200, Ketil Malde wrote: > > lu...@die.net.au writes: > > > > > I'm relatively new to haskell so as one does, I am rewriting an > > > existing program in haskell to help learn the language. > >

Re: [Haskell-cafe] List and description of language extensions

2009-04-03 Thread Michael Snoyman
On Fri, Apr 3, 2009 at 7:16 AM, Brandon S. Allbery KF8NH < allb...@ece.cmu.edu> wrote: > On 2009 Apr 3, at 0:00, Michael Snoyman wrote: > > It's been multiple times now that I've been confounded by something in > Haskell which was then solved by a language extension (first > FunctionalDependencies

Re: [Haskell-cafe] Re: Reverting to any old version using Darcs

2009-04-03 Thread Peter Verswyvelen
Regarding these files that people forget to checkin. Doesn't every project have a well define directory structure? Shouldn't the "prefs/boring" file use this fact to encapsulate the rules of file inclusion and exclusion? Isn't it safer to checkin too many files (by accident) than forgetting one? Sh

Re: [Haskell-cafe] Program using 500MB RAM to process 5MB file

2009-04-03 Thread lucas
On Fri, Apr 03, 2009 at 10:22:07AM +0200, Ketil Malde wrote: > lu...@die.net.au writes: > > > I'm relatively new to haskell so as one does, I am rewriting an > > existing program in haskell to help learn the language. > > > However, it eats up all my RAM whenever I run the program. > > This typi

[Haskell-cafe] how to upgrade?

2009-04-03 Thread Johannes Waldmann
Is there a nice way of upgrading ghc: I mean does cabal-upgrade know to install exactly the packages that I had with the previous ghc version? - J.W. signature.asc Description: OpenPGP digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskel

Re: [Haskell-cafe] Wishful thinking: a text editor that expands function applications into function definitions

2009-04-03 Thread Claus Reinke
One word says more than a thousand pictures: Vim . (well, okay, I'm sure Emacs will do just as well, and some of the more recent IDEs seem to be catching up;-) plus plugins, of course!-) - unfolding definitions: if you really want that, it is in the domain of program tra

Re: [Haskell-cafe] Program using 500MB RAM to process 5MB file

2009-04-03 Thread Malcolm Wallace
> > (2) You are parsing strictly, meaning you have to read the whole > > input file before anything can be output. This is likely the main performance problem. I'm guessing you are using parsec. Try switching to polyparse if you want to try out lazy parser combinators instead. (module Text.Pa

Re: [Haskell-cafe] Re: Reverting to any old version using Darcs

2009-04-03 Thread Malcolm Wallace
> > Thus the uploaded sdist was missing one of the source files, and > > consequently failed to build. > > I have a pre-release make target where I test everything I can think > of. I think it prevents the above, am I right ? Not unless you run 'make check' in a separate pristine copy of the r

Re: [Haskell-cafe] Program using 500MB RAM to process 5MB file

2009-04-03 Thread Ketil Malde
lu...@die.net.au writes: > I'm relatively new to haskell so as one does, I am rewriting an > existing program in haskell to help learn the language. > However, it eats up all my RAM whenever I run the program. This typically happens to me when I parse large files and either am a) using a parser

Re: [Haskell-cafe] Problem with prepose.lhs and ghc6.10.1

2009-04-03 Thread Claus Reinke
Hugs did not support lexically scoped type variables then (and probably doesn't support now). I may be misremembering, but I think Hugs had them first;-) http://cvs.haskell.org/Hugs/pages/hugsman/exts.html#sect7.3.3 It is just that Hugs and GHC interpret the language extension differently (as