Re: [Haskell-cafe] ANN: bimap 0.1 - a bidirectional map

2008-02-04 Thread Neil Mitchell
Hi Stuart, Data.Bimap is a data structure that represents a bidirectional mapping between two key types. A bimap has two type parameters; each value in the bimap is associated with exactly one value of the opposite type. In other words, it's a bijection between (subsets of) its argument

[Haskell-cafe] Re: Re[2]: Cabal, GHC, FFI and Visual Studio on Windows

2008-02-04 Thread Aaron Denney
On 2008-02-03, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello Duncan, Sunday, February 3, 2008, 5:24:22 AM, you wrote: Ok, so you could create a separate component to produce the .dll / .a from the C code but you'd prefer the convenience of being able to just: c-sources: blah.c and have

Re: [Haskell-cafe] Re: Re[2]: Cabal, GHC, FFI and Visual Studio on Windows

2008-02-04 Thread Magnus Therning
Aaron Denney wrote: On 2008-02-03, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello Duncan, Sunday, February 3, 2008, 5:24:22 AM, you wrote: Ok, so you could create a separate component to produce the .dll / .a from the C code but you'd prefer the convenience of being able to just:

Re: [Haskell-cafe] ANN: bimap 0.1 - a bidirectional map

2008-02-04 Thread Stuart Cook
On Mon, Feb 4, 2008 at 7:56 PM, Neil Mitchell [EMAIL PROTECTED] wrote: A few design differences from your one: * I called my module BiMap rather than Bimap - I debated this with a collegue, and we settled on the capital M, but it was a very close call. Mine was also originally BiMap, but

module hierarchy (Re: [Haskell-cafe] parsec3 pre-release [important note])

2008-02-04 Thread Wolfgang Jeltsch
Am Samstag, 2. Februar 2008 05:53 schrieb Derek Elkins: I forgot to mention that the Text.Parsec modules should be preferred to the Text.ParserCombinators.Parsec modules as the Haddock documentation reveals. I would have prefered to shorten ParserCombinators to Parsing and leave Parsec under

[Haskell-cafe] ANN: heap-0.2

2008-02-04 Thread Stephan Friedrichs
A flexible heap implementation supporting min-, max- and custom-ordered heaps. New features since version 0.1: - Foldable and Read instance - filter, partition - subrange functions: take, drop, splitAt, takeWhile, span, break

Re: [Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

2008-02-04 Thread Alfonso Acosta
On Feb 4, 2008 12:36 PM, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Am Samstag, 2. Februar 2008 14:54 schrieben Sie: Again, if someone complains about the TH dependency, the aliases could be generated by TH but saved statically in a module for each release. Hmm, this could be a compromise

Re: [Haskell-cafe] Circular enums

2008-02-04 Thread Henning Thielemann
On Sat, 2 Feb 2008, Ben Butler-Cole wrote: [Resend with formatting maybe fixed.] Hello I'm trying to define functions that allow you to traverse a bounded enumeration, wrapping at the start and the end. My implementation looks like this: next, prev :: (Enum a, Bounded a) = a - a

[Haskell-cafe] building the unix package and cabal

2008-02-04 Thread Galchin Vasili
Hello, I have been trying to build the unix package on RedHat RHEL 5. Over the weekend I read through the Cabal documentation. The unix-2.2.0.0 unix.cabal specifies the build-type attribute as Configure. Based on Cabal doc, I should run ./configure. After this step then what? Bottom line is

Re: [Haskell-cafe] modeling ANSI C structs in Haskell?

2008-02-04 Thread Peter Gammie
Vasili, On 04/02/2008, at 10:04 PM, Galchin Vasili wrote: I am reading through the FFI doc. Any suggestions on enabling Haskell programmers to model ANSI C structs that will be passed down to C run-time? The FFI spec is a wonderful document, but is of limited use in learning to

Re: [Haskell-cafe] A handy little consequence of the Cont monad

2008-02-04 Thread Philip Armstrong
On Fri, Feb 01, 2008 at 10:19:17PM +, Lennart Augustsson wrote: It's a matter of taste. I prefer the function composition in this case. It reads nicely as a pipeline. (Hoping not to contribute to any flamage...) I've always liked $ for this kind of code, if you want to keep the

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Adrian Hey
Simon Peyton-Jones wrote: | Yes, using lots of stack is clearly bad with ghc, but this is a ghc | bug. In fact the only reason these programs do use lots of stack | (vs. heap) is just a peculiarity of ghc rts implementation, so it | really should be ghc that fixes the problem, or at least admits

Re: [Haskell-cafe] fmap vs. liftM

2008-02-04 Thread Miguel Mitrofanov
Problem is that from the idea Functor is a superclass of Monad, with the property that fmap == liftM. [cut] The second relation can even not be expressed in Haskell 98. Erm... class Functor f where fmap :: (a - b) - f a - f b class Functor m = Monad m where return :: a - m a

RE: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Simon Peyton-Jones
| Sorry, but if what you say is true then things are even worse than I | thought :-( This behaviour seems really bad to me, especially for | concurrent programs. Which behaviour precisely? Can you say what is wrong and what behaviour you expect? S

Re: [Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

2008-02-04 Thread Wolfgang Jeltsch
Am Montag, 4. Februar 2008 13:22 schrieben Sie: On Feb 4, 2008 12:36 PM, Wolfgang Jeltsch wrote: […] I don't still know how many people would be interested in using the type-level library so, again, I think it won't hurt to include the TH-generated aliases and then change it if some non-GHC

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Neil Mitchell
Hi But if a program or library is deliberately designed to make use of stack (in preference to heap) for efficiency reasons then this is a source of bugs in otherwise perfectly correct and reasonable programs. Can you give an example of a particular library or program, so everyone can be a

Re: [Haskell-cafe] Bug in System.Environment - EOT inserted into argument string

2008-02-04 Thread David Fox
I think it is a bug in the emacs shell mode. On Feb 4, 2008 9:30 AM, Clifford Beshers [EMAIL PROTECTED] wrote: No, I cannot reproduce this. 2008/2/4 David Fox [EMAIL PROTECTED]: I'm seeing the character ^D inserted into argument strings that are about 256 characters long with GHC 6.8.2.

Re: [Haskell-cafe] fmap vs. liftM

2008-02-04 Thread Derek Elkins
On Mon, 2008-02-04 at 12:22 -0200, Felipe Lessa wrote: Hi there, Reading http://www.haskell.org/haskellwiki/Things_to_avoid I found an interesting saying: By the way, in the case of IO monad the Functor class method fmap and the Monad based function liftM are the same. I always tought

Re: [Haskell-cafe] Bug in System.Environment - EOT inserted into argument string

2008-02-04 Thread Clifford Beshers
No, I cannot reproduce this. 2008/2/4 David Fox [EMAIL PROTECTED]: I'm seeing the character ^D inserted into argument strings that are about 256 characters long with GHC 6.8.2. Anyone else? Test.hs: module Main where import System.Environment import System.IO main = do args -

Re: [Haskell-cafe] building the unix package and cabal

2008-02-04 Thread Thomas Schilling
This is the GNU Multi-Precision library. You have to install that separately, Cabal can't do that for you. You should use the redhat package manager to install it. HTH On Feb 4, 2008 4:43 PM, Galchin Vasili [EMAIL PROTECTED] wrote: Hi Thomas, Have you tried to build this package

Re: [Haskell-cafe] building the unix package and cabal

2008-02-04 Thread Galchin Vasili
more specifically the gmp unsatisfied ref shows up with the DynamicLinker. On 2/4/08, Thomas Schilling [EMAIL PROTECTED] wrote: I don't know. Maybe someone on @cafe can help. (I CC'd) On Feb 4, 2008 5:22 PM, Galchin Vasili [EMAIL PROTECTED] wrote: I have the gmp shared objects installed,

[Haskell-cafe] Bug in System.Environment - EOT inserted into argument string

2008-02-04 Thread David Fox
I'm seeing the character ^D inserted into argument strings that are about 256 characters long with GHC 6.8.2. Anyone else? Test.hs: module Main where import System.Environment import System.IO main = do args - getArgs hPutStrLn stderr (args: ++ show args) Output: $ ghc6 --make

Re: [Haskell-cafe] building the unix package and cabal

2008-02-04 Thread Thomas Schilling
I don't know. Maybe someone on @cafe can help. (I CC'd) On Feb 4, 2008 5:22 PM, Galchin Vasili [EMAIL PROTECTED] wrote: I have the gmp shared objects installed, i.e. .so's. Does ghc require static linking with .a archive files? On 2/4/08, Thomas Schilling [EMAIL PROTECTED] wrote: This

[Haskell-cafe] Re: Data.Ord and Heaps (Was: Why functional programming matters)

2008-02-04 Thread Stephan Friedrichs
Hi, I'm sorry it took me so long to respond! [EMAIL PROTECTED] wrote: [newtype Ord a = Reverse a = Reverse { unReverse :: a }] This solution should be used for all collections depending on Ord instances, including Data.Map, Data.Set and others. As long as I only include it in my tiny heap

Re: [Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

2008-02-04 Thread Wolfgang Jeltsch
Am Samstag, 2. Februar 2008 14:54 schrieben Sie: On Feb 1, 2008 10:32 PM, Wolfgang Jeltsch wrote: Am Freitag, 1. Februar 2008 13:00 schrieb Alfonso Acosta: […] To make it friendlier for the end user I thought about defining aliases for lets say the first 1 numbers using Template

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Adrian Hey
Hello Simon, Simon Peyton-Jones wrote: | Sorry, but if what you say is true then things are even worse than I | thought :-( This behaviour seems really bad to me, especially for | concurrent programs. Which behaviour precisely? Can you say what is wrong and what behaviour you expect?

[Haskell-cafe] Is Haskore dead?

2008-02-04 Thread Maurí­cio
Hi, I've just tried using Haskore (I use Ubuntu and GHC), with no success. Since Haskore was started a long time ago, but it's not yet cabalized, and the author's page can not be reached, I can't say for sure if it's still maintained. Does anybody know? Thanks, Maurício

Re: [Haskell-cafe] modeling ANSI C structs in Haskell?

2008-02-04 Thread Magnus Therning
On 2/4/08, Galchin Vasili [EMAIL PROTECTED] wrote: Hello, I am reading through the FFI doc. Any suggestions on enabling Haskell programmers to model ANSI C structs that will be passed down to C run-time? Maybe this could offer some help http://therning.org/magnus/archives/315 /M

Re: module hierarchy (Re: [Haskell-cafe] parsec3 pre-release [important note])

2008-02-04 Thread Johan Tibell
On Feb 4, 2008 12:11 PM, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Am Samstag, 2. Februar 2008 05:53 schrieb Derek Elkins: I forgot to mention that the Text.Parsec modules should be preferred to the Text.ParserCombinators.Parsec modules as the Haddock documentation reveals. I would have

Re: [Haskell-cafe] fmap vs. liftM

2008-02-04 Thread Henning Thielemann
On Mon, 4 Feb 2008, Felipe Lessa wrote: Hi there, Reading http://www.haskell.org/haskellwiki/Things_to_avoid I found an interesting saying: By the way, in the case of IO monad the Functor class method fmap and the Monad based function liftM are the same. I always tought that prop ::

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Neil Mitchell
Hi First bad thing: Stack size (memory consumed) doubles each time it overflows. Bad thing? Assume that allocating memory takes some constant amount of time, such as invoking overflow behaviour etc. To get the size of the stack to n bytes with doubling takes O(log n), to get it there with a

Re: [Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

2008-02-04 Thread Wolfgang Jeltsch
Am Montag, 4. Februar 2008 20:44 schrieben Sie: I'll host the project in community.haskell.org, do you have an account there? Now, I haven't. :-( Well, you can request one at http://community.haskell.org/admin/account_request.html if you want Otherwise I'll take the maintainer role.

Re: [Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

2008-02-04 Thread Alfonso Acosta
On Feb 4, 2008 8:27 PM, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Am Montag, 4. Februar 2008 13:22 schrieben Sie: I don't still know how many people would be interested in using the type-level library so, again, I think it won't hurt to include the TH-generated aliases and then change it if

[Haskell-cafe] fmap vs. liftM

2008-02-04 Thread Felipe Lessa
Hi there, Reading http://www.haskell.org/haskellwiki/Things_to_avoid I found an interesting saying: By the way, in the case of IO monad the Functor class method fmap and the Monad based function liftM are the same. I always tought that prop :: (Functor m, Monad m, Eq (m b)) = (a - b) - m a -

[Haskell-cafe] modeling ANSI C structs in Haskell?

2008-02-04 Thread Galchin Vasili
Hello, I am reading through the FFI doc. Any suggestions on enabling Haskell programmers to model ANSI C structs that will be passed down to C run-time? Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Matthew Pocock
On Monday 04 February 2008, Adrian Hey wrote: Yikes! Also, I can't help thinking that the common justification for the current limit (that it helps find alleged bugs) is a little lame. It only helps find bugs if one expects ones program to use less than 8M of stack (hence if it's using more,

Re: [Haskell-cafe] Is Haskore dead?

2008-02-04 Thread gwern0
On 2008.02.04 16:11:55 -0200, Maurí­cio [EMAIL PROTECTED] scribbled 0.3K characters: Hi, I've just tried using Haskore (I use Ubuntu and GHC), with no success. Since Haskore was started a long time ago, but it's not yet cabalized, and the author's page can not be reached, I can't say for

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Matthew Pocock
On Monday 04 February 2008, Neil Mitchell wrote: Hi That would be nice. But its only beneficial if there are programs which takes large amounts of stack at some point, but then shrink down to very little stack and continue for a reasonable amount of time. From the 'when I was a lad'

Re: [Haskell-cafe] A handy little consequence of the Cont monad

2008-02-04 Thread Cale Gibbard
On 04/02/2008, Philip Armstrong [EMAIL PROTECTED] wrote: I've always liked $ for this kind of code, if you want to keep the arguments around: next xs = runCont $ sequence $ map Cont xs seems quite natural to me. I'd probably write that as nest xs = runCont . sequence . map Cont $ xs

Re: [Haskell-cafe] Adding gcc type options with cabal (e.g. -mno-cygwin)

2008-02-04 Thread Duncan Coutts
On Mon, 2008-02-04 at 17:18 -0500, bbrown wrote: Is there a way to pass misc options to the cabal, ghc process. I tried the following: extra-libraries: sqlite3 extra-lib-dirs: C:\cygwin\lib include-dirs:C:\cygwin\usr\include ghc-options:

Re: [Haskell-cafe] Adding gcc type options with cabal (e.g. -mno-cygwin)

2008-02-04 Thread bbrown
On Mon, 4 Feb 2008 14:24:12 -0800, Don Stewart wrote bbrown: Is there a way to pass misc options to the cabal, ghc process. I tried the following: extra-libraries: sqlite3 extra-lib-dirs: C:\cygwin\lib include-dirs:C:\cygwin\usr\include ghc-options:

[Haskell-cafe] Adding gcc type options with cabal (e.g. -mno-cygwin)

2008-02-04 Thread bbrown
Is there a way to pass misc options to the cabal, ghc process. I tried the following: extra-libraries: sqlite3 extra-lib-dirs: C:\cygwin\lib include-dirs:C:\cygwin\usr\include ghc-options: -mno-cygwin runhaskell Setup.lhs build --ghc-options=-mno-cygwin

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Adrian Hey
Neil Mitchell wrote: Hi First bad thing: Stack size (memory consumed) doubles each time it overflows. Bad thing? Assume that allocating memory takes some constant amount of time, such as invoking overflow behaviour etc. To get the size of the stack to n bytes with doubling takes O(log n), to

Re: [Haskell-cafe] building the unix package and cabal

2008-02-04 Thread Ian Lynagh
On Mon, Feb 04, 2008 at 10:50:13AM -0600, Galchin Vasili wrote: more specifically the gmp unsatisfied ref shows up with the DynamicLinker. This works for me, with GHC 6.8.2 and http://hackage.haskell.org/packages/archive/unix/2.2.0.0/unix-2.2.0.0.tar.gz $ ghc --make Setup $ ./Setup configure

[Haskell-cafe] FP and Quality

2008-02-04 Thread PR Stanley
Hi folks I'm thinking of writing a little essay arguing the case for the advantages of FP for producing quality software. Can the list recommend any papers/articles which I can use as sources of my argument? I have access to the IEEE database too although earlier I couldn't find anything on

Re: [Haskell-cafe] Adding gcc type options with cabal (e.g. -mno-cygwin)

2008-02-04 Thread Don Stewart
bbrown: Is there a way to pass misc options to the cabal, ghc process. I tried the following: extra-libraries: sqlite3 extra-lib-dirs: C:\cygwin\lib include-dirs:C:\cygwin\usr\include ghc-options: -mno-cygwin runhaskell Setup.lhs build

Re: [Haskell-cafe] FP and Quality

2008-02-04 Thread Tim Chevalier
On 2/4/08, PR Stanley [EMAIL PROTECTED] wrote: Hi folks I'm thinking of writing a little essay arguing the case for the advantages of FP for producing quality software. Can the list recommend any papers/articles which I can use as sources of my argument? I have access to the IEEE database too

Re: [Haskell-cafe] FP and Quality

2008-02-04 Thread PR Stanley
Thanks, keep the tips coming. I like the ones about the type safety and line counts. Cheers, Paul At 23:33 04/02/2008, you wrote: Good luck with this - I'd love to see the outcome. My experience is that FP tends to result in a lot less code, so if there are x bugs per line of code, FP has

Re: [Haskell-cafe] Adding gcc type options with cabal (e.g. -mno-cygwin)

2008-02-04 Thread bbrown
On Mon, 4 Feb 2008 17:27:30 -0500, bbrown wrote On Mon, 4 Feb 2008 14:24:12 -0800, Don Stewart wrote bbrown: Is there a way to pass misc options to the cabal, ghc process. I tried the following: extra-libraries: sqlite3 extra-lib-dirs: C:\cygwin\lib

Re: [Haskell-cafe] building the unix package and cabal

2008-02-04 Thread Galchin Vasili
Hi Ian, I am trying to add new Posix functionality and it would be nice to be able to build unix myself. In any case, I will try your suggestion and see what happens. Regards, Vasili On 2/4/08, Ian Lynagh [EMAIL PROTECTED] wrote: On Mon, Feb 04, 2008 at 10:50:13AM -0600, Galchin Vasili

Re: [Haskell-cafe] RE: highlighting-kate - syntax highlighting library

2008-02-04 Thread Duncan Coutts
On Sun, 2008-02-03 at 19:38 -0200, Felipe Lessa wrote: On Feb 3, 2008 6:42 PM, mgsloan [EMAIL PROTECTED] wrote: Would this be suitable for a text editor? Note that we already have a binding to GtkSourceView, see http://www.haskell.org/gtk2hs/docs/current/Graphics-UI-Gtk-SourceView.html

Re: [Haskell-cafe] A handy little consequence of the Cont monad

2008-02-04 Thread Derek Elkins
On Mon, 2008-02-04 at 16:56 -0500, Cale Gibbard wrote: On 04/02/2008, Philip Armstrong [EMAIL PROTECTED] wrote: I've always liked $ for this kind of code, if you want to keep the arguments around: next xs = runCont $ sequence $ map Cont xs seems quite natural to me. I'd

Re: [Haskell-cafe] fmap vs. liftM

2008-02-04 Thread Jonathan Cast
On 4 Feb 2008, at 6:22 AM, Felipe Lessa wrote: Hi there, Reading http://www.haskell.org/haskellwiki/Things_to_avoid I found an interesting saying: By the way, in the case of IO monad the Functor class method fmap and the Monad based function liftM are the same. I always tought that prop ::

Re: [Haskell-cafe] parsec3 pre-release [attempt 2]

2008-02-04 Thread Philippa Cowderoy
On Sun, 3 Feb 2008, Antoine Latter wrote: Another picky nit: The monad transformer type is defined as such: data ParsecT s u m a = ParsecT { runParsecT :: State s u - m (Consumed (m (Reply s u a))) } with the Consumed and reply types as: data Consumed a = Consumed a

Re: [Haskell-cafe] parsec3 pre-release [attempt 2]

2008-02-04 Thread Antoine Latter
On Feb 4, 2008 9:11 PM, Philippa Cowderoy [EMAIL PROTECTED] wrote: It's a necessary part of how Parsec works - both the Consumed and the Reply depend on the input stream, which is now generated from within the base monad. The Consumed result is evaluated in advance of the Reply, so keeping the

Re: [Haskell-cafe] Haskell maximum stack depth

2008-02-04 Thread Stefan O'Rear
On Mon, Feb 04, 2008 at 10:13:12PM +, Adrian Hey wrote: Also remember that this behaviour never wastes more than 50% of the stack, which is a relatively small amount. Only if the stack is relatively small. Would you say the same about heap, or about a stack that only needed 50% of heap

[Haskell-cafe] bimap 0.2

2008-02-04 Thread Stuart Cook
I've updated the bimap package to version 0.2. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bimap-0.2 The main difference is a pretty comprehensive interface shakeup: the Either variants have been dropped, all L variants have had the L removed from their name, and a few functions

Re: [Haskell-cafe] Adding gcc type options with cabal (e.g. -mno-cygwin)

2008-02-04 Thread Berlin Brown
On Feb 4, 2008 5:55 PM, Duncan Coutts [EMAIL PROTECTED] wrote: On Mon, 2008-02-04 at 17:18 -0500, bbrown wrote: Is there a way to pass misc options to the cabal, ghc process. I tried the following: extra-libraries: sqlite3 extra-lib-dirs: C:\cygwin\lib