Re: [Haskell-cafe] Haskell on the iPhone

2009-06-23 Thread Karel Gardas
Ryan Trinkle wrote: Rick, I know some work has been done on JVM - iirc, Don Stewart did some work back in the day, www.cse.unsw.edu.au/~pls/thesis/dons-thesis.ps.gz, but I'm not sure how comprehensive it is. Is anyone else interested in JVM-based Haskell targets? Hello, certainly I am.

[Haskell-cafe] Re: Optimizing spelling correction program

2009-06-23 Thread Kamil Dworakowski
Using Bryan O'Sullivan's fantastic BloomFilter I got it down below Python's run time! Now it is 35.56s, 28% of the time is spent on GC, which I think means there is still some room for improvement. One easy way to fix the GC time is to increase the default heap size.  ./a.out +RTS -A200M

[Haskell-cafe] Re: Optimizing spelling correction program

2009-06-23 Thread Kamil Dworakowski
On Jun 22, 10:12 pm, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Kamil, Tuesday, June 23, 2009, 12:54:49 AM, you wrote: I went back to using Strings instead of ByteStrings and with that hashtable the program finishes in 31.5s! w00t! and GC times are? also, try ByteString+HT,

Re: [Haskell-cafe] HaRe (the Haskell Refactorer) in action - short screencast

2009-06-23 Thread Deniz Dogan
2009/6/23 Claus Reinke claus.rei...@talk21.com: I've heard that many Haskellers know HaRe only as a rumour. It has been many years since the original project finished, and HaRe hasn't been maintained for quite some time, so just pointing to the sources isn't quite the right answer. The

Re: [Haskell-cafe] Getting my mind around UArray - STUArray conversion

2009-06-23 Thread Ryan Ingram
This is the best I could come up with. We let the compiler prove that s is irrelevant to the MArray instance for a particular instance of STUArray, and package up that knowledge using an existential type. We can then extract the instance for any type; in particular, the instance for the current

Re: [Haskell-cafe] IMO ghc 6.8.2 misleading warning messages

2009-06-23 Thread Matthijs Kooijman
Hi Vasili, IMO the warning messages should be reversed! (parseOptional was never used .. called ... but I would strongly prefer the type signature warning first. Can you motivate why? Any order looks fine to me... Gr. Matthijs signature.asc Description: Digital signature

Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

2009-06-23 Thread papa . eric
Simple: the definition of MonadState uses those extensions. Thanks, yes it helps and explains all. :^) I suppose then that if -XFlexibleContexts is indeed required by the standard libraries, it is a safe extension, meaning supported by all compilers? Are many such extensions de-facto standard

Re: [Haskell-cafe] Re: Optimizing spelling correction program

2009-06-23 Thread Bulat Ziganshin
Hello Kamil, Tuesday, June 23, 2009, 11:17:43 AM, you wrote: One easy way to fix the GC time is to increase the default heap size.  ./a.out +RTS -A200M It does make the GC only 1.4% of run time but it increases it overall by 14s. not surprising - you lose L2 cache locality. try to use -A

Forward compatibility (was Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature)

2009-06-23 Thread Luke Palmer
On Tue, Jun 23, 2009 at 2:20 AM, papa.e...@free.fr wrote: Simple: the definition of MonadState uses those extensions. Thanks, yes it helps and explains all. :^) I suppose then that if -XFlexibleContexts is indeed required by the standard libraries, it is a safe extension, meaning supported

Re: Forward compatibility (was Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature)

2009-06-23 Thread Matthijs Kooijman
Hi Luke, Simple: the definition of MonadState uses those extensions. [Snip question: Is this extension supported by all compilers] You should treat all compilers the same way as a universal quantifier in mathematics. It's not just all the compilers you know about, but all possible

Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

2009-06-23 Thread Luke Palmer
On Tue, Jun 23, 2009 at 2:20 AM, papa.e...@free.fr wrote: Simple: the definition of MonadState uses those extensions. Thanks, yes it helps and explains all. :^) I suppose then that if -XFlexibleContexts is indeed required by the standard libraries, it is a safe extension, meaning supported

[Haskell-cafe] INAP 2009: 2nd Call for Papers

2009-06-23 Thread Pedro Salgueiro
[apologies for cross-posting; please distribute] --- (PLEASE DISTRIBUTE) Second Call for Papers INAP 2009 18th International

[Haskell-cafe] Ann: Emping-0.6 and Tests/Examples

2009-06-23 Thread Hans van Thiel
Hello All, Version 0.6 of Emping is now, imo, at the level of a working prototype. It is available on Hackage (but won't build there because it uses Gtk2Hs. It did build with Cabal on FC8 with GhC 6.8 and Gtk2Hs 0.9.13). The package includes a user guide, but see the update on my web site about

Re: [Haskell-cafe] Re: ANN: haskell-src-exts-1.0.0

2009-06-23 Thread Niklas Broberg
Hi Maurício, How far is Unicode from beeing parsed? It doesn't seem to be a huge step (from my ill-informed viewpoint), and it would not let behind those who are happy to be able to declare names in their own native language. (Oh, and sorry for resorting to politically correct blackmail...)

[Haskell-cafe] Generate Fortran 77 parser from a yacc grammar using Happy

2009-06-23 Thread Cetin Sert
I have stumbled upon the following F77 yacc grammar: http://yaxx.cvs.sourceforge.net/viewvc/yaxx/yaxx/fortran/fortran.y?revision=1.3view=markup . How can I make a Fortran 77 parser out of this file using Happyhttp://www.haskell.org/happy/ ? Why is there some C?/C++? code in that .y file?

Re: [Haskell-cafe] Haskell on the iPhone

2009-06-23 Thread John A. De Goes
I have strong interest in Haskell on the JVM. Not for Android, however. Seems like every time this topic comes up, the consensus is that it's not easy to support new targets with GHC, but that work is underway to make such developments easier. Regards, John A. De Goes N-Brain, Inc. The

Re: [Haskell-cafe] Haskell on the iPhone

2009-06-23 Thread Jeff Heard
This is great news! I'd love to be able to write our cellphone automated vehicle location clients in Haskell. -- Jeff On Mon, Jun 22, 2009 at 6:38 PM, Don Stewartd...@galois.com wrote: If you're doing it in Haskell, please feel free to keep plugging. A new market for Haskell apps is highly

[Haskell-cafe] memoization using unsafePerformIO

2009-06-23 Thread Jan Christiansen
Hi, I have tried to implement a memo function using stable names and weak pointers like it is presented in the paper stretching the storage manager. There is an abstract datatype SNMap a b which implements a map that maps values of type StableName a to values of type b. The map is

Re: [Haskell-cafe] How to determine if a FilePath is a directory name or regular file?

2009-06-23 Thread Brandon S. Allbery KF8NH
On Jun 22, 2009, at 07:37 , Duncan Coutts wrote: One explanation is that isBlah asks is this thing a blah, but we're not asking that because there is an indirection via the filepath. We're asking does this filepath refer to a directory not is this filename a directory. The latter could be a

Re: [Haskell-cafe] Haskell on the iPhone

2009-06-23 Thread Rick R
There seems to be quite a bit more interest now in supporting platforms other than win/*nix on x86 these days*. Maybe now there will be sufficient motivation to make the fundamental changes required. Caveat: I have absolutely no idea of the scope or complexity of said changes. I will look through

RE: [Haskell-cafe] Haskell on the iPhone

2009-06-23 Thread Simon Peyton-Jones
Good news about the iPhone port! There seems to be quite a bit more interest now in supporting platforms other than win/*nix on x86 these days*. Maybe now there will be sufficient motivation to make the fundamental changes required. Caveat: I have absolutely no idea of the scope or complexity

Re: [Haskell-cafe] Haskell on the iPhone

2009-06-23 Thread John A. De Goes
How about setting up some sort of Summer of Code-type project, where companies can pledge dollars toward a certain goal, which will cover the cost of the work? Is there someone at GHC HQ who could provide guidance to a sponsored developer working on getting additional targets into HEAD?

Re: [Haskell-cafe] How to determine if a FilePath is a directory name or regular file?

2009-06-23 Thread Duncan Coutts
On Tue, 2009-06-23 at 09:31 -0400, Brandon S. Allbery KF8NH wrote: On Jun 22, 2009, at 07:37 , Duncan Coutts wrote: One explanation is that isBlah asks is this thing a blah, but we're not asking that because there is an indirection via the filepath. We're asking does this filepath refer

Re[2]: [Haskell-cafe] How to determine if a FilePath is a directory name or regular file?

2009-06-23 Thread Bulat Ziganshin
Hello Duncan, Tuesday, June 23, 2009, 6:34:17 PM, you wrote: import System.Posix.Files (getFileStatus, isDirectory) Yeah, if we could make a standard portable variant of this, that'd be great. isdir - withFileStatus isdir? filename isDirectory module System.Directory withFileStatus ::

RE: [Haskell-cafe] rewrite rules

2009-06-23 Thread Simon Peyton-Jones
| I have a rewrite rule as follows: | | {-# RULES | transform/transform forall (f::forall m. Monoid m = (a - m) - (b - | m)) | (g::forall m. Monoid m = (b - m) - (c | - m)) | (l::FMList c). transform f (transform g | l) = transform

[Haskell-cafe] Re: [Haskell] ANN: Reusable Corecursive Queues via Continuations

2009-06-23 Thread Felipe Lessa
On Mon, Jun 22, 2009 at 10:31:34PM -0400, Leon Smith wrote: Also, a substantially revised draft of the associated paper, Lloyd Allison's Corecursive Queues: Why Continuations Matter is now available. [3] This paper will appear in the upcoming Monad Reader issue 14, and comments would be

[Haskell-cafe] ICFP contest

2009-06-23 Thread Rafael Gustavo da Cunha Pereira Pinto
Hi, The good folks here are really quiet about the ICFP Contest. Is anyone participating this year? As in the previous four years, I will probably download the problem, take a look, and try for a while... Having a family don't allow me to go much further, especially when teaming up with myself!

Re: [Haskell-cafe] ICFP contest

2009-06-23 Thread Miguel Mitrofanov
Well, I can make a bit more concrete prediction. I'll download the problem, take a look, try for a while, discover, that it's too hard to be cracked at once, and lose interest. That sounds like a reason why I'm not participating. On 23 Jun 2009, at 22:49, Rafael Gustavo da Cunha Pereira

Re: [Haskell-cafe] Type system trickery

2009-06-23 Thread Andrew Coppin
Ross Mellgren wrote: This works for me: {-# LANGUAGE EmptyDataDecls, GADTs #-} module Main where data NoZoo data Zoo newtype X = X Int deriving (Show) newtype Y = Y Char deriving (Show) data Foobar a where Foo :: X - Y - Foobar NoZoo Bar :: X - Y - Foobar NoZoo Zoo :: Foobar

AW: [Haskell-cafe] ICFP contest

2009-06-23 Thread Nicu Ionita
Last year the problem was not too bad, but I failed because I didn't have a working linux installation and the live cd started on my notebook in the first day, but in the second no more (you had to deliver a linux binary). Two years ago there was no need to deliver a binary, but I did not have

[Haskell-cafe] ANN: New release of ZeroTH

2009-06-23 Thread Robin Green
This announcement will only be of interest to Haskell programmers using, or thinking of using, Template Haskell. I am very pleased to announce a new release (2009.6.23.3) of ZeroTH (also known as zeroth), a tool for preprocessing Haskell code to run splices and remove Template Haskell

Re: [Haskell-cafe] Could FFI support pass-by-value of structs?

2009-06-23 Thread John Meacham
On Tue, Jun 16, 2009 at 10:48:19AM -0300, Maurí­cio wrote: It's not usual, but it is allowed to have values of structs passed between functions directly instead of using pointers: /*/ struct ex { int x; int y; int z; }; ex example_functions (ex p) { (...) }

Re: [Haskell-cafe] Could FFI support pass-by-value of structs?

2009-06-23 Thread Felipe Lessa
On Tue, Jun 16, 2009 at 10:48:19AM -0300, Maurí­cio wrote: /*/ struct ex { int x; int y; int z; }; ex example_functions (ex p) { (...) } /*/ You may adopt the approach I used with Hipmunk[1] where there is a wrapper library written in C. For your example you

Re: [Haskell-cafe] Type system trickery

2009-06-23 Thread Brandon S. Allbery KF8NH
On Jun 22, 2009, at 14:43 , Andrew Coppin wrote: data Foobar a where Foo :: X - Y - Foobar NoZoo Bar :: X - Y - Foobar NoZoo Zoo :: Foobar NoZoo - Foobar Zoo For some reason, if I do this I get endless type check errors. I have to change the top two back to Foobar a before it will work.

Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

2009-06-23 Thread Eric Dedieu
Thanks for your answers. I still have a question, though... I think the reasoninging here is the following: If MonadState is part of the standard library and it needs this extension to work, then all compilers must support this extension. Yes, exactly, that was my point. I'm not completely

Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

2009-06-23 Thread Luke Palmer
On Tue, Jun 23, 2009 at 6:05 PM, Eric Dedieu papa.e...@free.fr wrote: So 1) How can I use transformers instead of the mtl? This is in no tutorial, and searchinf for mtl on the haskell wiki yields no result at all. cabal install transformers (you need cabal-install to do this... consult

Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

2009-06-23 Thread Brandon S. Allbery KF8NH
On Jun 22, 2009, at 20:02 , Eric wrote: Non type-variable argument in the constraint: MonadState [a] m (Use -XFlexibleContexts to permit this) In the type signature for `play3': play3 :: (MonadState [a] m, Eq a) = a - m Bool So how is it possible that GHCi can infer (and use) a

Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

2009-06-23 Thread Luke Palmer
On Tue, Jun 23, 2009 at 6:05 PM, Eric Dedieu papa.e...@free.fr wrote: Now, trying to avoid duplicate code at this very level of simplicity seems to require compiler extensions! Here it is: On a higher level, in case you are interested, here's a description of how I would model your problem.

Re: [Haskell-cafe] Type system trickery

2009-06-23 Thread Ross Mellgren
I'm no expert, but it seems like those constructors should return Foobar NoZoo, unless you're nesting so there could be a Zoo, in which case the type variable a should transit, for example: data Foobar a where Foo :: X - Y - Foobar NoZoo Bar :: X - Y - Foobar NoZoo Baz :: Foobar

Re: [Haskell-cafe] HaRe (the Haskell Refactorer) in action - short screencast

2009-06-23 Thread Mattias Bengtsson
On Tue, 2009-06-23 at 00:02 +0100, Claus Reinke wrote: [...] With the recent interest in screencasts, I thought I'd make a little demo, for archival purposes. [...] Impressive! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Generate Fortran 77 parser from a yacc grammar using Happy

2009-06-23 Thread Brandon S. Allbery KF8NH
On Jun 23, 2009, at 07:57 , Cetin Sert wrote: Why is there some C?/C++? code in that .y file? It has the look of a production grammar with the reduction actions stripped out (but whatever they used didn't strip the %{ initializer block). I would say that, for starters, you want to strip

Re: [Haskell-cafe] How to determine if a FilePath is a directory name or regular file?

2009-06-23 Thread Brandon S. Allbery KF8NH
On Jun 23, 2009, at 10:34 , Duncan Coutts wrote: On Tue, 2009-06-23 at 09:31 -0400, Brandon S. Allbery KF8NH wrote: Hypothetical? import System.Posix.Files (getFileStatus, isDirectory) Yeah, if we could make a standard portable variant of this, that'd be great. I've wanted to do that

Re: Forward compatibility (was Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature)

2009-06-23 Thread Brandon S. Allbery KF8NH
On Jun 23, 2009, at 05:20 , Luke Palmer wrote: obsolete now, will your code still work when they are gone? Will it still work when the typeclass resolution algorithm is obsoleted by a superior algorithm (I'm looking at you, Oleg! :-)? When Haskell is obsolete, how hard will it be to port?

[Haskell-cafe] Re: Re[2]: Re: (fwd) Haskell logo fail

2009-06-23 Thread Benjamin L . Russell
On Thu, 18 Jun 2009 12:13:09 +0400, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello minh, Thursday, June 18, 2009, 11:17:07 AM, you wrote: Why don't we have a picture of a cool dinosaur instead? Something cool because the last heat of life went out of it 65 million years ago?

Re: [Haskell-cafe] Type system trickery

2009-06-23 Thread David Menendez
On Tue, Jun 23, 2009 at 9:25 PM, Ross Mellgrenrmm-hask...@z.odi.ac wrote: I'm no expert, but it seems like those constructors should return Foobar NoZoo, unless you're nesting so there could be a Zoo, in which case the type variable a should transit, for example: data Foobar a where    Foo