[Haskell] small boys performance

2007-03-14 Thread Andrzej Jaworski
Hi Knights, As I regretfully pointed out earlier in [Fwd: Re: Computer Language Shootout] large search and simulations are not for Haskell. This is equally true with GHC 6.5 http://eric_rollins.home.mindspring.com/haskellAnt.html. Also there is much illusion about Haskell potential ease at

[Haskell] APLAS'07 CFP

2007-03-14 Thread Henrik Nilsson
Posted on behalf of Zhong Shao - The Fifth ASIAN Symposium on Programming Languages and Systems (APLAS 2007) CALL FOR PAPERS Singapore

Re: [Haskell] small boys performance

2007-03-14 Thread Johan Henriksson
Andrzej Jaworski wrote: Hi Knights, As I regretfully pointed out earlier in [Fwd: Re: Computer Language Shootout] large search and simulations are not for Haskell. This is equally true with GHC 6.5 http://eric_rollins.home.mindspring.com/haskellAnt.html. After checking the code I must

Re: [Haskell] small boys performance

2007-03-14 Thread Dan Piponi
On 3/14/07, Andrzej Jaworski [EMAIL PROTECTED] wrote: A thing where Haskell could potentially offer something that a regular CAS cannot is calculating a tensors with symbolic indices (without components) so that one could have components calculated for specific cases on the end of general

Re: [Haskell] small boys performance

2007-03-14 Thread Andrzej Jaworski
I am glad you are interested Dan. I would give Haskell a clean start, particularly in the light of what Johan has just said. Calling external CAS engine (Matlab style) makes little sense since tensor work is done in external packages and Haskell has its own interesting libraries that could be

[Haskell] same type multiply implementing a class

2007-03-14 Thread Daniel Mahler
Is there any way for the same type to implement a typeclass multiple ways. The particular situation I have in mind is composing two monad trasformers of the same type, say reader monad. In pure theory one reader can lift through another, but in an implementation one gets a name clash. thanks

Re: [GHC] #1200: ghci scripts ending in printf lines fail with Exception: Prelude.undefined

2007-03-14 Thread GHC
#1200: ghci scripts ending in printf lines fail with Exception: Prelude.undefined +--- Reporter: dons| Owner: igloo Type: bug | Status: new Priority: normal

Re: [GHC] #1223: ghc-6.6: panic! (the 'impossible' happened)

2007-03-14 Thread GHC
#1223: ghc-6.6: panic! (the 'impossible' happened) ---+ Reporter: [EMAIL PROTECTED] | Owner: Type: bug| Status: closed Priority: normal | Milestone:

Re: [GHC] #1221: Types don't match expressions in type error

2007-03-14 Thread GHC
#1221: Types don't match expressions in type error -+-- Reporter: igloo| Owner: Type: bug | Status: new Priority: normal |

Re: [GHC] #1221: Types don't match expressions in type error

2007-03-14 Thread GHC
#1221: Types don't match expressions in type error -+-- Reporter: igloo| Owner: Type: bug | Status: new Priority: low |

Re: How about change prep-bin-dist-mingw's default enviroment up todate?

2007-03-14 Thread Claus Reinke
The nightly builds are moving to BuildBot (in case you hadn't noticed). We have 4 Windows builds in BuildBot: nightly HEAD/6.6 and fast HEAD/6.6. Currently I'm not building any distributions from these builds, but I'd like to. thanks for the update, Simon. there are many things i get out of

Re: [GHC] #1194: tcrun032 regressed

2007-03-14 Thread GHC
#1194: tcrun032 regressed --+- Reporter: igloo | Owner: Type: bug | Status: closed Priority: normal| Milestone: 6.6.1 Component: Compiler |Version: 6.6

Visual Haskell Installation issues

2007-03-14 Thread OJ
Hi Guys, I just wanted to let you know that I haven't been able to successfully install Visual Haskell on my system. I am running: Windows XP x64 Visual Studio 2005 SP1 The process fails when it attempts to register the components for use with Visual Studio. I'm not sure if this is

Re: [GHC] #1210: Unimplemented opcode error while running ZFS

2007-03-14 Thread Pasqualino 'Titto' Assini
Hi, are you sure that this is the same bug? Bug 1013 appears to have been fixed in GHC 6.6. while this bug is still present in 6.6. Regards, titto On Wednesday 14 March 2007 06:49:13 GHC wrote: #1210: Unimplemented opcode error while running ZFS

Re: [GHC] #1209: getMBlocks: misaligned block returned

2007-03-14 Thread GHC
#1209: getMBlocks: misaligned block returned --+- Reporter: CBa | Owner: Type: bug | Status: new Priority: normal

Re: [GHC] #1210: Unimplemented opcode error while running ZFS

2007-03-14 Thread Ian Lynagh
On Wed, Mar 14, 2007 at 09:42:36AM +, Pasqualino 'Titto' Assini wrote: are you sure that this is the same bug? Bug 1013 appears to have been fixed in GHC 6.6. while this bug is still present in 6.6. 1013 has been fixed in the 6.6 branch (so 6.6.1 will be fixed), but 6.6 itself is

Re: How about change prep-bin-dist-mingw's default enviroment up todate?

2007-03-14 Thread Simon Marlow
Claus Reinke wrote: ps there has to be a less ugly way to get the doc path than this, though: ghc-pkg field base haddock-html | sed -e 's/^[^:]*: //' -e 's/$topdir/echo `ghc --print-libdir`/e' http://hackage.haskell.org/trac/ghc/ticket/937 This fix will be in 6.6.1. Cheers,

Re: How about change prep-bin-dist-mingw's default enviroment up todate?

2007-03-14 Thread Claus Reinke
ps there has to be a less ugly way to get the doc path than this, though: ghc-pkg field base haddock-html | sed -e 's/^[^:]*: //' -e 's/$topdir/echo `ghc --print-libdir`/e' http://hackage.haskell.org/trac/ghc/ticket/937 This fix will be in 6.6.1. great, thanks! that almost makes my

Re: [GHC] #1082: Documentation missing from MacOS PPC binary

2007-03-14 Thread GHC
#1082: Documentation missing from MacOS PPC binary ---+ Reporter: guest | Owner: thorkilnaur Type: bug| Status: new Priority: normal | Milestone: 6.6.1

[GHC] #1224: ghci failed to load

2007-03-14 Thread GHC
#1224: ghci failed to load +--- Reporter: guest| Owner: Type: bug | Status: new Priority: high | Milestone: Component: GHCi |

[GHC] #1225: configure of yi generates error message on AMD 64-bit OpenBSD 4.0

2007-03-14 Thread GHC
#1225: configure of yi generates error message on AMD 64-bit OpenBSD 4.0 ---+ Reporter: guest | Owner: Type: bug | Status: new Priority: normal |

Re: [GHC] #1225: configure of yi generates error message on AMD 64-bit OpenBSD 4.0

2007-03-14 Thread GHC
#1225: configure of yi generates error message on AMD 64-bit OpenBSD 4.0 --+- Reporter: guest | Owner: Type: bug | Status: new Priority: normal|

[GHC] #1226: Add flags --full-flag-help and --print-docdir

2007-03-14 Thread GHC
#1226: Add flags --full-flag-help and --print-docdir +--- Reporter: igloo| Owner: Type: feature request | Status: new Priority: normal | Milestone: 6.8

[GHC] #1227: Crash with biographical profiling on OS X

2007-03-14 Thread GHC
#1227: Crash with biographical profiling on OS X ---+ Reporter: Judah Jacobson | Owner: Type: bug | Status: new Priority: normal | Milestone:

[GHC] #1228: GHCi freezes in Windows upon pressing Ctrl+C (always, not just under cygwin)

2007-03-14 Thread GHC
#1228: GHCi freezes in Windows upon pressing Ctrl+C (always, not just under cygwin) +--- Reporter: guest| Owner: Type: bug | Status: new Priority: normal | Milestone:

Re: Feature proposal: ghc --full-flag-help ?

2007-03-14 Thread Ketil Malde
Simon Peyton-Jones [EMAIL PROTECTED] writes: Suppose ghc --full-flag-help simply printed the URL http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html Or suppose it did 'system(man ghc)'? -k -- If I haven't seen further, it is by standing in the footprints

Re: Still trying to build unregisterised for FreeBSD/amd64

2007-03-14 Thread Simon Marlow
Ian Lynagh wrote: I think they should pretty much work with the 6.6 branch, although I'm also not convinced by the Don't worry if the build falls over in the RTS, we don't need the RTS yet. comment. That may well not be true, feel free to replace it with something more accurate. I haven't

Re: Feature proposal: ghc --full-flag-help ?

2007-03-14 Thread Seth Kurtzberg
No disagreement; the text man page should also be a file in the distribution with a name that suggests its contents. On Wed, 14 Mar 2007 11:18:20 + Simon Marlow [EMAIL PROTECTED] wrote: Marc Weber wrote: On Tue, Mar 13, 2007 at 01:57:10PM +0100, Marc Weber wrote: Hi I did notice a

Re: Feature proposal: ghc --full-flag-help ?

2007-03-14 Thread Marc Weber
On Wed, Mar 14, 2007 at 11:18:20AM +, Simon Marlow wrote: We already have support for man pages, I think we should try to avoid duplication here. If your GHC man page is installed correctly, then 'man ghc' should give you a nice consise list of options (see attached file, and scripts

scripts on unix

2007-03-14 Thread Frederik Eaton
Hello, What is the proper technique for creating a Haskell script on a Unix system? e.g. with Perl I do #!/usr/bin/env perl print hello world\n; or #!/usr/bin/perl print hello world\n; I tried $ cat test #!/usr/bin/env runhaskell module Main where main = do putStrLn hello world But

Re: Feature proposal: ghc --full-flag-help ?

2007-03-14 Thread John Meacham
On Wed, Mar 14, 2007 at 11:18:20AM +, Simon Marlow wrote: We already have support for man pages, I think we should try to avoid duplication here. If your GHC man page is installed correctly, then 'man ghc' should give you a nice consise list of options (see attached file, and scripts

Re: scripts on unix

2007-03-14 Thread Seth Kurtzberg
I compile the programs, instead of trying to run them as scripts. Is there any reason you prefer to interpret the scripts? I'm not saying it's not a legitimate thing to do, just wondering why you prefer to do it that way. Seth Kurtzberg On Wed, 14 Mar 2007 19:31:55 + Frederik Eaton

Re: scripts on unix

2007-03-14 Thread Bulat Ziganshin
Hello Frederik, Wednesday, March 14, 2007, 10:31:55 PM, you wrote: What is the proper technique for creating a Haskell script on a Unix system? try to give them a .hs extension :) -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re: scripts on unix

2007-03-14 Thread Frederik Eaton
Scripts are tidy, since they're also a source file and you don't have to worry about keeping a separate binary executable up to date. I'm sure this topic has been well discussed on the vast internet. For instance, look at Setup.hs in Cabal. That could be called a script, because it is rarely

Re: scripts on unix

2007-03-14 Thread Matthew Danish
On Wed, Mar 14, 2007 at 07:31:55PM +, Frederik Eaton wrote: Hello, What is the proper technique for creating a Haskell script on a Unix system? File.lhs: #!/usr/bin/env runhaskell \begin{code} ... \end{code} With a literate code file, the #! should cause no issues. -- -- Matthew

Re: scripts on unix

2007-03-14 Thread David Brown
Frederik Eaton wrote: Scripts are tidy, since they're also a source file and you don't have to worry about keeping a separate binary executable up to date. I'm sure this topic has been well discussed on the vast internet. For instance, look at Setup.hs in Cabal. That could be called a script,

Re: [GHC] #1215: GHC fails to respect the maximal munch rule while lexing qualified reservedids

2007-03-14 Thread Simon Marlow
Ian Lynagh wrote: Context if you haven't been following: http://hackage.haskell.org/trac/ghc/ticket/1215 On Tue, Mar 13, 2007 at 03:12:33PM -, GHC wrote: Interesting. It turns out I misinterpreted the Haskell lexical syntax: GHC lexes `M.default` as `M` `.` `default`, because

Re: [Haskell-cafe] Defining types (newbie)

2007-03-14 Thread Bryan O'Sullivan
John Fouhy wrote: But if I want to combine tcEqOne and tcGtThree I run into type problems, because one of them uses Strings and the other Integers. Yep. The observation you can make here is that TC is really a fancy way to write a function that takes some parameters and returns a Bool. So

[Haskell-cafe] Re: Foralls in records

2007-03-14 Thread apfelmus
Adde wrote: I'm experimenting with implementing database transactions as monads but I'm getting stuck on how to store a generic connection (only constrained by a typeclass) inside the transaction. The reason I'm doing it this way is that the connection could be a different kind of structure

[Haskell-cafe] Re: Defining types (newbie)

2007-03-14 Thread apfelmus
John Fouhy wrote: [...] data Thing = Thing { field_one :: String, field_two :: String, field_three :: Integer } type BooleanOp a = a - a - Bool type Field a = Thing - a data ThingCompare a = TC (BooleanOp a) (Field a) | And (ThingCompare a) (ThingCompare a)

Re: [Haskell-cafe] c2hs and pthreadtypes.h

2007-03-14 Thread Magnus Therning
On Wed, Mar 14, 2007 at 12:27:10 +1100, Duncan Coutts wrote: [..] Yes, I do have a C parser that can parse the linux kernel and that of course includes anonymous structs and unions. Currently I'm part way through merging these changes into the darcs version of c2hs. Excellent news! So, Magnus,

Re: [Haskell-cafe] Parallelism on concurrent?

2007-03-14 Thread Bjorn Bringert
On Mar 13, 2007, at 17:26 , Dusan Kolar wrote: Hello all, I'm googling around haskell.org to get some deeper knowledge about Control.Parallel.Strategies than it is presented on http:// www.haskell.org/ghc/docs/latest/html/libraries/base/Control- Parallel-Strategies.html BTW, could someone

[Haskell-cafe] Re: Foralls in records

2007-03-14 Thread Martin Huschenbett
Hi, instead of writing a function getTransaction that retrieves the connection you could write a function withConnection that doesn't return the connection itself but performs an operation on the connection: withConnection :: (forall c. Connection c = c - Transaction a) - Transaction

RE: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Simon Peyton-Jones
| The error in linux is: | Illegal instance declaration for `Read (UArray Int Double)' | (The instance type must be of form (T a b c) | where T is not a synonym, and a,b,c are distinct type variables) | In the instance declaration for `Read (UArray Int Double)' | | Why

Re: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Björn Bringert
Simon Peyton-Jones wrote: | The error in linux is: | Illegal instance declaration for `Read (UArray Int Double)' | (The instance type must be of form (T a b c) | where T is not a synonym, and a,b,c are distinct type variables) | In the instance declaration for `Read

[Haskell-cafe] Re: Foralls in records

2007-03-14 Thread Adde
Martin Huschenbett huschi at gmx.org writes: Hi, instead of writing a function getTransaction that retrieves the connection you could write a function withConnection that doesn't return the connection itself but performs an operation on the connection: withConnection ::

Re: [Haskell-cafe] Re: Foralls in records

2007-03-14 Thread Chris Kuklewicz
I can't seem to find any examples of how to actually implement liftIO for a monad. Any ideas/pointers? Searching the haskell wiki for MonadIO gives several examples. http://haskell.org/haskellwiki/New_monads/MonadExit instance MonadIO m = MonadIO (ExitT e m) where liftIO = lift .

[Haskell-cafe] Re: Foralls in records

2007-03-14 Thread Adde
Matthew Brecknell haskell at brecknell.org writes: Since the concrete type has been forgotten, there's no way to get it back. You can't write a function that exposes the forgotten type, so getConnection is basically a lost cause. When you write getConnection :: Transaction c, you are saying

[Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-14 Thread John Goerzen
On 2007-03-13, Brandon Michael Moore [EMAIL PROTECTED] wrote: On Mon, Mar 12, 2007 at 05:14:57PM -0500, John Goerzen wrote: You can do this with runProcess, if you use System.Posix.IO.{createPipe,fdToHandle} to make a pipe and wrap the ends as handles. I hope hCreatePipe could be implemented

[Haskell-cafe] Re: Foralls in records

2007-03-14 Thread Adde
Do you want to mix differently typed Connections inside a single transaction? It looks like you don't, so you may well leave out existential types altogether and simply parametrize the Transaction monad on the type of the connection it uses. data Connection c = TransactionState c = TS c

lazily handling exceptions in lazy sources (Re: [Haskell-cafe] Re: Takusen and strictness, and perils of getContents)

2007-03-14 Thread Claus Reinke
Is this really a solution? Currently, getContents reports no errors but does perfect error recovery: the result of the computation prior to the error is preserved and reported to the caller. Imprecise exceptions give us error reporting -- but no error recovery. All previously computed results are

[Haskell-cafe] principle types

2007-03-14 Thread Vikrant
Hi, I can understand why principle type of map is map :: (a - b) - [a] - [b] , I would interpret this as map takes a function of type a-b and a list of type [a] as arguments and returns a list of type [b] but it is going somewhat beyond my imagination why principle type of map map is (map

Re: [Haskell-cafe] principle types

2007-03-14 Thread Paul Johnson
Vikrant wrote: (map map)::[a - b] - [[a] - [b]] I am able to interpret the expressions [a - b] - [[a] - [b]] vaguely... does this mean that 'map map' takes list of functions of type (a-b) and returns list of functions of type ([a]-[b]) if yes ..how do I derive it from basic type

Re: [Haskell-cafe] principle types

2007-03-14 Thread Jules Bean
Vikrant wrote: Hi, I can understand why principle type of map is map :: (a - b) - [a] - [b] , I would interpret this as map takes a function of type a-b and a list of type [a] as arguments and returns a list of type [b] but it is going somewhat beyond my imagination why principle type

Re: [Haskell-cafe] principle types

2007-03-14 Thread Big Chris
Hi Vikrant, The other two have said basically the same thing as me, but your description of map's type makes me think maybe an explanation of curried functions is in order: map is what's called a curried function. Basically, the type: (a - b) - [a] - [b] has two interpretations. The

RE: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Simon Peyton-Jones
Ah, a fine idea. I'll do that anyway; maybe others will have even better ideas, but that's a good start S | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Björn | Bringert | Sent: 14 March 2007 14:28 | To: Simon Peyton-Jones | Cc:

[Haskell-cafe] Re: Foralls in records

2007-03-14 Thread apfelmus
Adde wrote: Do you want to mix differently typed Connections inside a single transaction? It looks like you don't, so you may well leave out existential types altogether and simply parametrize the Transaction monad on the type of the connection it uses. data Connection c = TransactionState

Re[2]: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Bulat Ziganshin
Hello Bjorn, Wednesday, March 14, 2007, 5:27:35 PM, you wrote: I'm not the original poster, but what about just changing it to The instance type must be of the form (T a1 ... an) where T is not a synonym, and a1 ... an are distinct type variables)? or even better, are distinct type

Re: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Alex Queiroz
Hallo, On 3/14/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote: Ah, a fine idea. I'll do that anyway; maybe others will have even better ideas, but that's a good start Ah! So now I knows what it means. I've also been beaten by this error message a couple of days ago. Cheers, -- -alex

[Haskell-cafe] Re: Foralls in records

2007-03-14 Thread Adde
Chris Kuklewicz haskell at list.mightyreason.com writes: Searching the haskell wiki for MonadIO gives several examples. http://haskell.org/haskellwiki/New_monads/MonadExit instance MonadIO m = MonadIO (ExitT e m) where liftIO = lift . liftIO Where you can see you are just

Re: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Dan Piponi
On 3/14/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote: However, you mis-read the error message to say the instance type must have three parameters, which isn't what I meant at all! I was trying to use an example of the general form, but conveyed the wrong idea. Oh! I've been wondering

[Haskell-cafe] Re: small boys performance

2007-03-14 Thread apfelmus
-- redirected from haskell.general Andrzej Jaworski wrote: As I regretfully pointed out earlier in [Fwd: Re: Computer Language Shootout] large search and simulations are not for Haskell. This is equally true with GHC 6.5 http://eric_rollins.home.mindspring.com/haskellAnt.html. Indeed,

Re: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread SevenThunders
You guys are awesome! I post this not 12 hours ago and I already have a complete treatise on the subject. Yeah to clarify things putting an ellipsis between b and c would help. But also clarify the meaning of distinct type variables. Does this mean the type variable must not be parameterized?

Re[2]: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Bulat Ziganshin
Hello SevenThunders, Wednesday, March 14, 2007, 10:32:23 PM, you wrote: the type variables are dark side of GHC, and you need to have at least 1 mlOleg of brain to understand them. it will be great if someone will ever write reasonable introduction into this. meanwhile, you can look into ghc

[Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Pete Kazmier
When using readFile to process a large number of files, I am exceeding the resource limits for the maximum number of open file descriptors on my system. How can I enhance my program to deal with this situation without making significant changes? My program takes one or more directories that

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Donald Bruce Stewart
pete-expires-20070513: When using readFile to process a large number of files, I am exceeding the resource limits for the maximum number of open file descriptors on my system. How can I enhance my program to deal with this situation without making significant changes? Read in data strictly,

[Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-14 Thread Pete Kazmier
[EMAIL PROTECTED] (Donald Bruce Stewart) writes: pete-expires-20070513: When using readFile to process a large number of files, I am exceeding the resource limits for the maximum number of open file descriptors on my system. How can I enhance my program to deal with this situation without

[Haskell-cafe] Re: [Haskell] small boys performance

2007-03-14 Thread Dan Piponi
On 3/14/07, Andrzej Jaworski [EMAIL PROTECTED] wrote: I am glad you are interested Dan. ... I do not intend to bore anybody with differential geometry but as I was pushed that far let me add that if Haskell was made to handle Riemannian geometry it could be useful in next generation machine

Re: [Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-14 Thread Donald Bruce Stewart
pete-expires-20070513: [EMAIL PROTECTED] (Donald Bruce Stewart) writes: pete-expires-20070513: When using readFile to process a large number of files, I am exceeding the resource limits for the maximum number of open file descriptors on my system. How can I enhance my program to deal

Re: [Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-14 Thread Dougal Stanton
Quoth Pete Kazmier, nevermore, the same error regarding max open files. Incidentally, the lazy bytestring version of my program was by far the fastest and used the least amount of memory, but it still crapped out regarding max open files. I've tried the approach you appear to be using and

[Haskell-cafe] How to convert Num a = a to Int

2007-03-14 Thread Sergey Perminov
As a beginner I want to implement such fuction: plusSecs :: Num a = a - ClockTime - ClockTime plusSecs n = addToClockTime ( secTimeDiff (n) ) where secTimeDiff n = TimeDiff { tdYear = 0, tdMonth = 0,

Re: [Haskell-cafe] How to convert Num a = a to Int

2007-03-14 Thread Brandon S. Allbery KF8NH
On Mar 14, 2007, at 19:30 , Sergey Perminov wrote: So, the question is: Is it possible somehow to convert any Num (or at least Integral) to Int. Please, tell me if I don't get smth in Haskell type system. fromIntegral. Try http://haskell.org/hoogle for searching for useful functions like

[Haskell-cafe] SYB vs HList (again)

2007-03-14 Thread S. Alexander Jacobson
Right now I am looking at using either SYB (Scrap Your Boilerplate) or HList Records to eliminate boilerplate for: * parsing URLEncoded strings into application data structures * generating XML/JSON from application data structures * handling adding new fields to serialized data

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Greg Fitzgerald
Pete, mapM fileContentsOfDirectory = mapM_ print . threadEmails . map parseEmail . concat By using the IO monad you've /scheduled/ your first 'print' to occur after your last 'readFile', so every file is opened before the first file is read. I've come across the same problem and

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Matthew Brecknell
Pete Kazmier: When using readFile to process a large number of files, I am exceeding the resource limits for the maximum number of open file descriptors on my system. How can I enhance my program to deal with this situation without making significant changes? AFAIU, file handles opened by

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread David Brown
Greg Fitzgerald wrote: What we need is a library for a readonly filesystem. That is, all the same functions but pure. I believe you could make this readonly library by wrapping each readonly I/O function with 'unsafeInterleaveIO' or 'unsafePerformIO', but I don't really understand the

Re: [Haskell-cafe] How to convert Num a = a to Int

2007-03-14 Thread Albert Y. C. Lai
Moreover: from RealFrac to Int (or Integral): truncate, round, ceiling, or floor, depending on how you want to lose information. from Num to Int: there is none with such generality, since there are too many conceivable variations. ___

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Claus Reinke
When using readFile to process a large number of files, I am exceeding the resource limits for the maximum number of open file descriptors on my system. How can I enhance my program to deal with this situation without making significant changes? .. 1. Read contents of all files returning a

[Haskell-cafe] N and R are categories, no?

2007-03-14 Thread Steve Downey
EOk, i'm trying to write down, not another monad tutorial, because I don't know that much yet, but an explication of my current understanding of monads. But before I write down something that is just flat worng, I thought I'd get a cross check. (and I can't get to #haskell) Monads are Functors.

Re: [Haskell-cafe] Re: Foralls in records

2007-03-14 Thread Matthew Brecknell
Adde: Thanks, using pattern matching to avoid mentioning the type didn't even cross my mind. You are correct in assuming that I thought I could get away with getConnection :: Connection c = Transaction c. To be honest, I still don't understand why it's too polymorphic. To me it says

Re: [Haskell-cafe] Read Instance for UArray won't port to linux

2007-03-14 Thread Steve Downey
It's not just type variables. Type classes looked innocent, but smuggled an entire turing complete generic meta computation system into the language. Just thank SIMON that the error messages aren't as bad as C++ and templates. This does imply that mOleg have some equivalence relation to

Re: [Haskell-cafe] Re: small boys performance

2007-03-14 Thread Steve Downey
Many years ago, I got a B- in abstract algebra, and an A+ in differential geometry. Now I know why I worry about the blue glow of an unplanned criticality excursion occuring in my brain. On 3/14/07, Dan Piponi [EMAIL PROTECTED] wrote: On 3/14/07, Andrzej Jaworski [EMAIL PROTECTED] wrote: I

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Donn Cave
When using readFile to process a large number of files, I am exceeding the resource limits for the maximum number of open file descriptors on my system. How can I enhance my program to deal with this situation without making significant changes? I note that if you use mmap(2) to map a disk

Re: [Haskell-cafe] principle types

2007-03-14 Thread Vikrant
woow :) I am loving this language. Thank you all for very useful hints and thanks for the exercise about map.map! On 14/03/07, Big Chris [EMAIL PROTECTED] wrote: Hi Vikrant, The other two have said basically the same thing as me, but your description of map's type makes me think maybe an

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Donald Bruce Stewart
donn: When using readFile to process a large number of files, I am exceeding the resource limits for the maximum number of open file descriptors on my system. How can I enhance my program to deal with this situation without making significant changes? I note that if you use mmap(2) to

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Donn Cave
Quoth [EMAIL PROTECTED] (Donald Bruce Stewart): ... | In fact, the (commented out code) for mmapFile :: FilePath - IO ByteString | is in Data.ByteString now. You can also provide munmap as the finaliser, | and let the GC take care of that. It does make more sense to unmap the string when it's the

[Haskell-cafe] Jaskell, has anybody tried it?

2007-03-14 Thread Lars Johansson
Hello, I have installed the Jaskell libraries for java under Eclipse, but I can't get it running and the documentation on installing is really sparse. So any help I will apprreciate. Or any ideas! Sincerely Lars Johansson