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

2009-06-22 Thread Colin Paul Adams
I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter. -- Colin Adams Preston Lancashire ___

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

2009-06-22 Thread Judah Jacobson
On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul Adamsco...@colina.demon.co.uk wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter.

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

2009-06-22 Thread Erik de Castro Lopo
Colin Paul Adams wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter. The first example in this chapter of Real World Haskell

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

2009-06-22 Thread Bulat Ziganshin
Hello Colin, Monday, June 22, 2009, 10:12:57 AM, you wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns sub-directories as well as file names. I want only the latter, so I'm looking for a suitable filter. isdir -

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

2009-06-22 Thread Colin Paul Adams
Judah == Judah Jacobson judah.jacob...@gmail.com writes: Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul Judah Adamsco...@colina.demon.co.uk wrote: I've been hoogling like bad to try to determine if a function like this exists. getDirectoryContents returns

Re: [Haskell-cafe] Cross platform getProcessID

2009-06-22 Thread John Lask
The short anser is...you need to make a ffi call to getCurrentProcessId unfortunately there is no binding to this function in System.Win32.Process which is the natural home for it. Perhaps you could submit a patch for Win32 package, once you have created the binding the signature for the

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

2009-06-22 Thread Deniz Dogan
2009/6/22 Colin Paul Adams co...@colina.demon.co.uk: Judah == Judah Jacobson judah.jacob...@gmail.com writes:    Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul    Judah Adamsco...@colina.demon.co.uk wrote:     I've been hoogling like bad to try to determine if a function     like this

Re: [Haskell-cafe] Suggestion for Network.Socket in regards to PortNumber

2009-06-22 Thread Johan Tibell
On Mon, Jun 22, 2009 at 1:22 AM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: I'm in favor of the entire Network library being reworked with an improved API that is higher level and type-safe instead of a direct translation/FFI of Berkeley sockets. I also would like the Network

Re: [Haskell-cafe] ANNOUNCE fmlist

2009-06-22 Thread Sebastian Fischer
On Jun 19, 2009, at 7:12 PM, Sjoerd Visscher wrote: I see you did performance tests. How does your current version compare to f.e. one based on DiffLists? The current versions (0.4) of bfs and idfs based on FMList (0.5) use the same amount of memory and are about 10-15% slower than

Re: [Haskell-cafe] Optimizing spelling correction program

2009-06-22 Thread Ketil Malde
Kamil Dworakowski ka...@dworakowski.name writes: Right... Python uses hashtables while here I have a tree with log n access time. I did not want to use the Data.HashTable, it would pervade my program with IO. The alternative is an ideal hashmap that never gets changed. This program creates a

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Jules Bean
Magnus Therning wrote: Also from experience, I get a good feeling about software that compiles without warnings. It suggests the author cares and is indicative of some level of quality. In contrast, I find almost all the GHC warnings to be useless, and therefore turn them off. I don't find

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Miguel Mitrofanov
I so don't want to be the one supporting your code... Jules Bean wrote on 22.06.2009 13:00: Magnus Therning wrote: Also from experience, I get a good feeling about software that compiles without warnings. It suggests the author cares and is indicative of some level of quality. In contrast,

Re: [Haskell-cafe] Optimizing spelling correction program

2009-06-22 Thread Eugene Kirpichov
Hey, you're using String I/O! nWORDS - fmap (train . map B.pack . words) (readFile big.txt) This should be WORDS - fmap (train . B.words) (B.readFile big.txt) By the way, which exact file do you use as a misspellings file? The corpus linked to at Norvig's page has many. And do you have a

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Erik de Castro Lopo
Magnus Therning wrote: Speaking from experience it's good to fix all warnings, This was may experience from the C programming language. since otherwise there will be enough of them to cause a few terminal pages to scroll by when you compile and then there's a real danger of not noticing

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Jules Bean
Miguel Mitrofanov wrote: I so don't want to be the one supporting your code... Well, that's lucky. Because you aren't. However, that's an easy arrow to fling. I say I don't find warnings useful so you suggest my code is unmaintainable. Is that based on any knowledge of my code, or the GHC

[Haskell-cafe] rewrite rules

2009-06-22 Thread Sjoerd Visscher
Hi all, 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 (g.f) l

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Miguel Mitrofanov
Jules Bean wrote on 22.06.2009 13:09: Miguel Mitrofanov wrote: I so don't want to be the one supporting your code... Well, that's lucky. Because you aren't. Exactly. However, that's an easy arrow to fling. I say I don't find warnings useful so you suggest my code is unmaintainable. Is

Re: [Haskell-cafe] Optimizing spelling correction program

2009-06-22 Thread Ketil Malde
Johan Tibell johan.tib...@gmail.com writes: Typo? Bloom filters have O(1) lookup and tries O(m) lookup where m is the number of characters in the string. Typically you need to examine the (whole) search string in order to compute the hash function, so I think it is fair to consider them both

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Malcolm Wallace
Erik de Castro Lopo mle...@mega-nerd.com wrote: Vasili I. Galchin wrote: where/let functions use the same name for function parameters as the outer function and hence there is a shadow warning from the compiler. In Haskell there is an easy way around this. Variables can be name a,

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Neil Brown
Jules Bean wrote: I've been using GHC for years and my honest opinion is that the warnings very rarely flag an actual maintainability problem in the code I write, and very frequently annoying highlight something I knew I was doing, and did quite deliberately - most often inexhaustive patterns

Re: [Haskell-cafe] Creating a new Haskell mailing list

2009-06-22 Thread Ryan Trinkle
I'm interested in creating a list for iPhone development. While I also have an ongoing iPhone build target project, which I will be open-sourcing very soon, I'd like the list to be about Haskell on iPhone without regard to whether it has anything to do with my project. Ryan On Fri, Jun 19,

[Haskell-cafe] Re: Creating a new Haskell mailing list

2009-06-22 Thread Benjamin L . Russell
On Wed, 17 Jun 2009 20:38:54 -0400, Ryan Trinkle ryant5...@gmail.com wrote: Hi all, I'm interested in starting a mailing list on haskell.org. Who should I talk to about such things? One way is to propose the mailing list on the Haskell mailing list (see the Haskell Info Page at

Re: [Haskell-cafe] Optimizing spelling correction program

2009-06-22 Thread Johan Tibell
On Mon, Jun 22, 2009 at 12:05 PM, Ketil Malde ke...@malde.org wrote: Johan Tibell johan.tib...@gmail.com writes: Typo? Bloom filters have O(1) lookup and tries O(m) lookup where m is the number of characters in the string. Typically you need to examine the (whole) search string in order

[Haskell-cafe] STM/Data Invariant related Segfault with GHC 6.10.3

2009-06-22 Thread Jan Schaumlöffel
Hello, I just discovered that programs compiled with GHC 6.10.3 segfault when accessing a TVar created under certain conditions. This happens when the TVar is created and a data invariant is added (using alwaysSucceeds) in the same atomic block. The invariant does not necessarily have to read

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Johan Tibell
On Mon, Jun 22, 2009 at 12:06 PM, Malcolm Wallace malcolm.wall...@cs.york.ac.uk wrote: Erik de Castro Lopo mle...@mega-nerd.com mle%2...@mega-nerd.com wrote: Vasili I. Galchin wrote: where/let functions use the same name for function parameters as the outer function and hence

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

2009-06-22 Thread Duncan Coutts
On Mon, 2009-06-22 at 08:53 +0200, Deniz Dogan wrote: 2009/6/22 Colin Paul Adams co...@colina.demon.co.uk: Judah == Judah Jacobson judah.jacob...@gmail.com writes: Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul Judah Adamsco...@colina.demon.co.uk wrote: I've been hoogling

[Haskell-cafe] Re: Creating a new Haskell mailing list

2009-06-22 Thread Benjamin L . Russell
Most likely, if you propose your new mailing list (on the Haskell mailing list), the discussion will focus on whether it will be likely to gather enough posts to stay reasonably active. While the definition of reasonably active differs depending on the individual, it is likely to mean somewhere

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Erik de Castro Lopo
Malcolm Wallace wrote: When I write code that shadows variable names, it is always deliberate. In fact, the language's lexical rules encourage shadowing, otherwise why have scopes at all? I think bug-introduction by the elimination of shadowing is much more common than bug-elimination by the

Re: [Haskell-cafe] Cross platform getProcessID

2009-06-22 Thread John Van Enk
Hi John, The short anser is...you need to make a ffi call to getCurrentProcessId unfortunately there is no binding to this function in System.Win32.Process which is the natural home for it. Perhaps you could submit a patch for Win32 package, once you have created the binding the signature

Re: [Haskell-cafe] Documentation on hackage

2009-06-22 Thread Duncan Coutts
On Mon, 2009-06-15 at 06:49 -0700, Don Stewart wrote: si: Dear Haskellers, who needs this kind of documentation? http://hackage.haskell.org/packages/archive/tfp/0.2/doc/html/Types-Data-Num-Decimal-Literals.html isn't this a kind of spam? Seems like a good case for the

Re: [Haskell-cafe] Suggestion for Network.Socket in regards to PortNumber

2009-06-22 Thread Thomas DuBuisson
Johan - glad you chimed in! I'm all in favor of keeping a low level interface and don't have an issue with Network.Socket existing, I additionally really like the suggestion of moving from the ML to a wiki in the same style as Haskell'. I'll port these comments to the wiki if that is whats

Re: [Haskell-cafe] Suggestion for Network.Socket in regards to PortNumber

2009-06-22 Thread John Van Enk
Moving off list to the Wiki has my vote. On Mon, Jun 22, 2009 at 7:52 AM, Thomas DuBuissonthomas.dubuis...@gmail.com wrote: Johan - glad you chimed in! I'm all in favor of keeping a low level interface and don't have an issue with Network.Socket existing,  I additionally really like the

Re: [Haskell-cafe] Suggestion for Network.Socket in regards to PortNumber

2009-06-22 Thread Johan Tibell
On Mon, Jun 22, 2009 at 1:52 PM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: Johan - glad you chimed in! I'm all in favor of keeping a low level interface and don't have an issue with Network.Socket existing, I additionally really like the suggestion of moving from the ML to a wiki

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

2009-06-22 Thread Deniz Dogan
2009/6/22 Duncan Coutts duncan.cou...@worc.ox.ac.uk: On Mon, 2009-06-22 at 08:53 +0200, Deniz Dogan wrote: 2009/6/22 Colin Paul Adams co...@colina.demon.co.uk: Judah == Judah Jacobson judah.jacob...@gmail.com writes:    Judah On Sun, Jun 21, 2009 at 11:12 PM, Colin Paul    Judah

[Haskell-cafe] Re: Optimizing spelling correction program

2009-06-22 Thread Kamil Dworakowski
On Jun 22, 10:03 am, Eugene Kirpichov ekirpic...@gmail.com wrote: Hey, you're using String I/O! nWORDS - fmap (train . map B.pack . words) (readFile big.txt) This should be WORDS - fmap (train . B.words) (B.readFile big.txt) By the way, which exact file do you use as a misspellings file?

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

2009-06-22 Thread Max Rabkin
On Mon, Jun 22, 2009 at 2:09 PM, Deniz Dogandeniz.a.m.do...@gmail.com wrote: I think see what you mean, but I find the argument more of an excuse to the poor naming than a solid argument for it. Following the convention and intuition that most users have should be more important than making

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Malcolm Wallace
Johan Tibell johan.tib...@gmail.com wrote: Example: f a b = g (a+b) (b-a) where g a c = a*c f a b = g (a+b) (b-a) where g a' c = a*c Actually there's a warning: interactive:1:34: Warning: Defined but not used: `a'' Clearly I simplified the example too far.

Re: [Haskell-cafe] Suggestion for Network.Socket in regards to PortNumber

2009-06-22 Thread Thomas DuBuisson
All, I've started to add to the network trac [1] - its just framework for now. Please do add proposals, organized comments, and feel free to alter the framework. I'm not sure how formal we'd like to make this so I haven't even tried to make guidelines for proposals. I'll add proposals and

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

2009-06-22 Thread Deniz Dogan
2009/6/22 Max Rabkin max.rab...@gmail.com: On Mon, Jun 22, 2009 at 2:09 PM, Deniz Dogandeniz.a.m.do...@gmail.com wrote: I think see what you mean, but I find the argument more of an excuse to the poor naming than a solid argument for it. Following the convention and intuition that most users

[Haskell-cafe] Re: coding standard question

2009-06-22 Thread Christian Maeder
Malcolm Wallace wrote: Johan Tibell johan.tib...@gmail.com wrote: Example: f a b = g (a+b) (b-a) where g a c = a*c The proper way to avoid shadowing in this simple case would be to make g global (and don't export it). f a b = g (a+b) (b-a) g a c = a*c f a b = g (a+b)

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

2009-06-22 Thread Ketil Malde
Deniz Dogan deniz.a.m.do...@gmail.com writes: 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. I think see what you

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

2009-06-22 Thread Max Rabkin
On Mon, Jun 22, 2009 at 2:54 PM, Deniz Dogandeniz.a.m.do...@gmail.com wrote: Are you saying that when a function is named isDirectory you expect it to only check for a trailing forward slash character? No. I'm saying that *if* isDirectory existed, then (isDirectory /no/such/directory/) should

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Jochem Berndsen
Jules Bean wrote: Magnus Therning wrote: Also from experience, I get a good feeling about software that compiles without warnings. It suggests the author cares and is indicative of some level of quality. In contrast, I find almost all the GHC warnings to be useless, and therefore turn

[Haskell-cafe] Re: haskelldb + sqlite problem.

2009-06-22 Thread GüŸnther Schmidt
Hi Cloud, this often occurs when the path to the database includes a non-ascii character. In my dev environment, the path to the database deliberately contains an umlaut and the original code base of hdbc.sqlite3 from John Goerzen, version 2.0 version 2.1 thus does not work. John

Re: [Haskell-cafe] Suggestion for Network.Socket in regards to PortNumber

2009-06-22 Thread Johan Tibell
On Mon, Jun 22, 2009 at 2:46 PM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: All, I've started to add to the network trac [1] - its just framework for now. Please do add proposals, organized comments, and feel free to alter the framework. I'm not sure how formal we'd like to make

[Haskell-cafe] ICFP09 Call for Participation

2009-06-22 Thread Matthew Fluet (ICFP Publicity Chair)
= Call for Participation The 14th ACM SIGPLAN International Conference on Functional Programming (ICFP 2009) http://www.cs.nott.ac.uk/~gmh/icfp09.html

Re: [Haskell-cafe] Type system trickery

2009-06-22 Thread Brent Yorgey
On Sun, Jun 21, 2009 at 09:16:12PM +0100, Andrew Coppin wrote: Niklas Broberg wrote: That's what GADTs are for: data Flag = HasZoo | NoZoo data Foobar a where Foo :: Foobar a - Foobar a Bar :: Foobar a - Foobar a Zoo :: Foobar a - Foobar HasZoo Ouch #1: This appears to

Re: [Haskell-cafe] rewrite rules

2009-06-22 Thread Daniel Schüssler
Hi Sjoerd, I don't know the cause of the problem, but if I add this rule, it works: {-# RULES inline_map forall g x. map g x = transform (. g) x -#} maybe, for whatever reason, the 'map' is inlined too late for the transform/transform rule to see it? Greetings, Daniel On Monday 22 June

Re: [Haskell-cafe] rewrite rules

2009-06-22 Thread Sjoerd Visscher
On Jun 22, 2009, at 6:38 PM, Ryan Ingram wrote: Not 100% sure (especially without source/core), but my guess is that the higher-rank types make the rule unlikely to fire. Try -ddump-simpl to see the core output, and look for places where you expect the rule to fire. I suspect you will find

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

2009-06-22 Thread Scott Michel
On Fri, Jun 19, 2009 at 7:08 PM, Dan Doeldan.d...@gmail.com wrote: Oops, I replied too hastily. What I wrote in my first mail is a problem, as witnessed by the ix and ix1 in the error message. However, it isn't the main error. The main error is that you have a monadic expression, with type

Re: [Haskell-cafe] rewrite rules

2009-06-22 Thread Ryan Ingram
Not 100% sure (especially without source/core), but my guess is that the higher-rank types make the rule unlikely to fire. Try -ddump-simpl to see the core output, and look for places where you expect the rule to fire. I suspect you will find that the types of f and g are not forall at that

Re: [Haskell-cafe] Type system trickery

2009-06-22 Thread Andrew Coppin
Brent Yorgey wrote: On Sun, Jun 21, 2009 at 09:16:12PM +0100, Andrew Coppin wrote: Niklas Broberg wrote: That's what GADTs are for: data Flag = HasZoo | NoZoo data Foobar a where Foo :: Foobar a - Foobar a Bar :: Foobar a - Foobar a Zoo :: Foobar a - Foobar HasZoo

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

2009-06-22 Thread Don Stewart
scooter.phd: On Fri, Jun 19, 2009 at 7:08 PM, Dan Doeldan.d...@gmail.com wrote: Oops, I replied too hastily. What I wrote in my first mail is a problem, as witnessed by the ix and ix1 in the error message. However, it isn't the main error. The main error is that you have a monadic

Re: [Haskell-cafe] Type system trickery

2009-06-22 Thread Niklas Broberg
Not nearly as annoying as this:  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. *sigh*

Re: [Haskell-cafe] Type system trickery

2009-06-22 Thread Thomas DuBuisson
Andrew Coppin said:  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. *sigh* That code snippet

[Haskell-cafe] ANN: hledger 0.6.1 released

2009-06-22 Thread Simon Michael
I have released hledger 0.6.1 which fixes a build problem with ghc 6.8. You can ignore this release if you use a newer ghc or if one of the http://hledger.org/binaries works for you. Thanks to Andreas Reuleaux for the report. More reports welcome on irc, list or

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

2009-06-22 Thread Bulat Ziganshin
Hello Scott, Monday, June 22, 2009, 10:23:42 PM, you wrote: wombat :: forall e ix s. (IArray UArray e, Ix ix, MArray (STUArray s) e (ST s)) = e - ix - UArray ix e - UArray ix e http://haskell.org/haskellwiki/Library/ArrayRef#Reimplemented_Arrays_library Unboxed arrays now can be used in

[Haskell-cafe] Re: Optimizing spelling correction program

2009-06-22 Thread Kamil Dworakowski
On Jun 22, 6:46 am, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Kamil, Monday, June 22, 2009, 12:01:40 AM, you wrote: Right... Python uses hashtables while here I have a tree with log n you can try this pure hashtable approach: import Prelude hiding (lookup) import qualified

Re: [Haskell-cafe] Type system trickery

2009-06-22 Thread Andrew Coppin
Niklas Broberg wrote: Not nearly as annoying as this: 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

Re: [Haskell-cafe] Type system trickery

2009-06-22 Thread Ross Mellgren
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 NoZoo - Foobar Zoo foobar

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

2009-06-22 Thread Daniel Fischer
Am Montag 22 Juni 2009 21:31:50 schrieb Kamil Dworakowski: On Jun 22, 6:46 am, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Kamil, Monday, June 22, 2009, 12:01:40 AM, you wrote: Right... Python uses hashtables while here I have a tree with log n you can try this pure

[Haskell-cafe] Re: Optimizing spelling correction program

2009-06-22 Thread Kamil Dworakowski
On Jun 22, 9:10 am, Ketil Malde ke...@malde.org wrote: Kamil Dworakowski ka...@dworakowski.name writes: Right... Python uses hashtables while here I have a tree with log n access time. I did not want to use the Data.HashTable, it would pervade my program with IO. The alternative is an ideal

[Haskell-cafe] Re: Optimizing spelling correction program

2009-06-22 Thread Kamil Dworakowski
On Jun 22, 9:06 pm, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Montag 22 Juni 2009 21:31:50 schrieb Kamil Dworakowski: On Jun 22, 6:46 am, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Kamil, Monday, June 22, 2009, 12:01:40 AM, you wrote: Right... Python uses

Re: [Haskell-cafe] haskelldb + sqlite problem.

2009-06-22 Thread John Goerzen
Magicloud Magiclouds wrote: Hi, I am using haskelldb and haskelldb-hdbc-sqlite3. Well, I finally got the source compiled and ran, I got this error: App: user error (SQL error: SqlError {seState = , seNativeError = 21, seErrorMsg = prepare 74: SELECT subject,\n timestamp\nFROM notes

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

2009-06-22 Thread Bulat Ziganshin
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, it should be pretty easy to write hashByteString -- Best regards, Bulat

Re: [Haskell-cafe] Re: haskelldb + sqlite problem.

2009-06-22 Thread John Goerzen
GüŸnther Schmidt wrote: Hi Cloud, this often occurs when the path to the database includes a non-ascii character. In my dev environment, the path to the database deliberately contains an umlaut and the original code base of hdbc.sqlite3 from John Goerzen, version 2.0 version 2.1 thus

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

2009-06-22 Thread Daniel Fischer
Am Montag 22 Juni 2009 22:54:49 schrieb Kamil Dworakowski: Wait! Have you typed that definition into the msg off the top of your head? :) No, took a bit of looking. I went back to using Strings instead of ByteStrings and with that hashtable the program finishes in 31.5s! w00t! Nice :D

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

2009-06-22 Thread Don Stewart
kamil: On Jun 22, 9:10 am, Ketil Malde ke...@malde.org wrote: Kamil Dworakowski ka...@dworakowski.name writes: Right... Python uses hashtables while here I have a tree with log n access time. I did not want to use the Data.HashTable, it would pervade my program with IO. The alternative

Re: [Haskell-cafe] Re: haskelldb + sqlite problem.

2009-06-22 Thread John Goerzen
John Goerzen wrote: I do recall some discussion about data within a database; I don't recall one about the filename of it, which would certainly be a separate discussion. I can see why a connectRaw or some such function could be I have just pushed a patch to my git repo that adds

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Henning Thielemann
On Mon, 22 Jun 2009, Jules Bean wrote: Miguel Mitrofanov wrote: I so don't want to be the one supporting your code... Well, that's lucky. Because you aren't. I think the most frequent warning which denotes actually an error for me, is the 'unused identifier' warning, since there are

Re: [Haskell-cafe] coding standard question

2009-06-22 Thread Henning Thielemann
On Mon, 22 Jun 2009, Malcolm Wallace wrote: Example: f a b = g (a+b) (b-a) where g a c = a*c ghc warns that g's parameter a shadows the parameter to f. So we introduce a primed identifier to eliminate the warning: f a b = g (a+b) (b-a) where g a' c = a*c Now, no warnings!

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

2009-06-22 Thread Bulat Ziganshin
Hello Don, Tuesday, June 23, 2009, 1:22:46 AM, you wrote: One easy way to fix the GC time is to increase the default heap size. ./a.out +RTS -A200M to be exact, -A isn't a heap size - it's frequency of generation-1 collections. by default, collection perfromed every 512kbytes, tied to L2

[Haskell-cafe] Re: haskelldb + sqlite problem.

2009-06-22 Thread GüŸnther Schmidt
Hi John, let me first of all apologize, I didn't mean to criticize you, I'm sure you had good reasons for those changes, I'm merely mean to state how they did affect me after switching to HDBC 2.1. Since after the rollback they no longer occurred I surmise that there is a connection. The

Re: [Haskell-cafe] Re: haskelldb + sqlite problem.

2009-06-22 Thread John Goerzen
GüŸnther Schmidt wrote: Hi John, let me first of all apologize, I didn't mean to criticize you, I'm sure you had good reasons for those changes, I'm merely mean to state how they did affect me after switching to HDBC 2.1. No, I completely understand and I'm not offended; but I didn't want

[Haskell-cafe] Haskell on the iPhone

2009-06-22 Thread Ryan Trinkle
Dear Haskellers, Recently, there's been a groundswell of activity in the Haskell community regarding the Haskell's use in developing iPhone games. The iPhone is a powerful, innovative platform (with a great monetization scheme, to boot), and it's not surprising that many of us would want to

[Haskell-cafe] FFI and heap memory usage limit

2009-06-22 Thread Marcin Kosiba
Hello, Recently I've come across a certain GC/FFI-related problem. I've googled a bit, but didn't find anything specific. I'm running certain simulations, which tend to allocate a lot of garbage in memory. Since this causes the OOM-killer to kill my simulation at 98%

Re: [Haskell-cafe] Haskell on the iPhone

2009-06-22 Thread Jason Dagit
On Mon, Jun 22, 2009 at 3:30 PM, Ryan Trinkle ryant5...@gmail.com wrote: Dear Haskellers, Recently, there's been a groundswell of activity in the Haskell community regarding the Haskell's use in developing iPhone games. The iPhone is a powerful, innovative platform (with a great

Re: [Haskell-cafe] Haskell on the iPhone

2009-06-22 Thread Ryan Trinkle
Jason, iPwn is currently in pre-production for its first title, which will be an action-RPG reminiscent of Diablo and Fallout. I'll try to keep the shameless plugging on Haskell-cafe to a minimum, but I make no promises :P I will definitely let people know when our website is put together in

Re: [Haskell-cafe] Haskell on the iPhone

2009-06-22 Thread Don Stewart
If you're doing it in Haskell, please feel free to keep plugging. A new market for Haskell apps is highly welcome. ryant5000: Jason, iPwn is currently in pre-production for its first title, which will be an action-RPG reminiscent of Diablo and Fallout. I'll try to keep the shameless

Re: [Haskell-cafe] FFI and heap memory usage limit

2009-06-22 Thread Bulat Ziganshin
Hello Marcin, Tuesday, June 23, 2009, 2:31:13 AM, you wrote: Now this took an odd turn, because the simulation started crashing with out-of-memory errors _after_ completing (during bz2 compression). I'm fairly certain this is a GC/FFI bug, because increasing the max heap didn't

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

2009-06-22 Thread Claus Reinke
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 sources are still available, and build with GHC 6.8.3

Re: [Haskell-cafe] Haskell on the iPhone

2009-06-22 Thread Daniel Peebles
How exciting! I fully support the creation of a new mailing list about iphone+haskell :) On Mon, Jun 22, 2009 at 6:30 PM, Ryan Trinkleryant5...@gmail.com wrote: Dear Haskellers, Recently, there's been a groundswell of activity in the Haskell community regarding the Haskell's use in developing

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

2009-06-22 Thread Eric
Hi haskell helpers, I am new to haskell (but enthusiast). I have begun to play with State and StateT, but this very simple exercice has led me to a strange situation where GHCi recognises and accepts the type of a function but GHC won't allow it as a type signature. Here is the example (which is

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

2009-06-22 Thread Felipe Lessa
On Tue, Jun 23, 2009 at 02:02:25AM +0200, Eric wrote: It seems that an extension is required: 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

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

2009-06-22 Thread Niklas Broberg
Fellow Haskelleers, It is with great pleasure I hereby announce the first stable release of the haskell-src-exts package, version 1.0.0! haskell-src-exts is a package for Haskell source code manipulation. In particular it defines an abstract syntax tree representation, and a parser and

Re: [Haskell-cafe] STM/Data Invariant related Segfault with GHC 6.10.3

2009-06-22 Thread Bertram Felgenhauer
Jan Schaumlöffel wrote: I just discovered that programs compiled with GHC 6.10.3 segfault when accessing a TVar created under certain conditions. This is a known bug, but it hasn't gotten much attention: http://hackage.haskell.org/trac/ghc/ticket/3049 Bertram

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

2009-06-22 Thread Maurí­cio
It is with great pleasure I hereby announce the first stable release of the haskell-src-exts package, version 1.0.0! There's a kind of programming work that have great intelectual impact, as it lets you see your code in diferent ways. Yours, however, is of a special kind, as it has a physical

[Haskell-cafe] IMO ghc 6.8.2 misleading warning messages

2009-06-22 Thread Vasili I. Galchin
Hello, For: parseOptional = Parse.parseOptional I got warning messages: Swish/HaskellUtils/ParseURI.hs:77:4: Warning: Defined but not used: `parseOptional' Swish/HaskellUtils/ParseURI.hs:77:4: Warning: Definition but no type signature for `parseOptional' Inferred

[Haskell-cafe] Re: Haskell on the iPhone

2009-06-22 Thread Benjamin L . Russell
On Mon, 22 Jun 2009 18:30:50 -0400, Ryan Trinkle ryant5...@gmail.com wrote: [...] I would like to take this opportunity to propose the creation of a haskell-iphone mailing list, so that all Haskellers working with the iPhone - whether for profit or for pleasure - can come together to make

Re: [Haskell-cafe] Haskell on the iPhone

2009-06-22 Thread Ryan Trinkle
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? Ryan On Mon, Jun 22, 2009 at 20:42, Rick R