Re: [GHC] #2273: inlining defeats seq

2008-05-21 Thread GHC
#2273: inlining defeats seq --+- Reporter: igloo | Owner: igloo Type: merge | Status: new Priority: normal| Milestone: Component: Compiler |Version: 6.9

Re: [GHC] #2293: Multiple declaration error shown multiple times

2008-05-21 Thread GHC
#2293: Multiple declaration error shown multiple times --+- Reporter: NeilMitchell | Owner: Type: bug | Status: closed Priority: normal| Milestone:

Re: [GHC] #2292: Poor error message if type signature lacks definition

2008-05-21 Thread GHC
#2292: Poor error message if type signature lacks definition --+- Reporter: NeilMitchell | Owner: Type: bug | Status: closed Priority: normal| Milestone:

[GHC] #2301: Proper handling of SIGINT/SIGQUIT

2008-05-21 Thread GHC
#2301: Proper handling of SIGINT/SIGQUIT +--- Reporter: duncan | Owner: Type: bug | Status: new Priority: normal | Component: libraries/base Version:

Re: [GHC] #1061: default class methods can be given too general a type as GHC tries to share them between instances

2008-05-21 Thread GHC
#1061: default class methods can be given too general a type as GHC tries to share them between instances --+- Reporter: igloo | Owner: igloo Type: merge | Status: new Priority:

Re: [GHC] #1955: Heap profiling on Windows doesn't work

2008-05-21 Thread GHC
#1955: Heap profiling on Windows doesn't work +--- Reporter: NeilMitchell| Owner: igloo Type: merge | Status: closed Priority: normal | Milestone: 6.8.3

Re: [GHC] #2002: problems with very large (list) literals

2008-05-21 Thread GHC
#2002: problems with very large (list) literals --+- Reporter: Isaac Dupree | Owner: simonmar Type: compile-time performance bug | Status: new Priority: high

Re: [GHC] #2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument)

2008-05-21 Thread GHC
#2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument) ---+ Reporter: slyfox | Owner: igloo Type: bug| Status:

[GHC] #2302: error messages mangle unicode characters

2008-05-21 Thread GHC
#2302: error messages mangle unicode characters +--- Reporter: guest| Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 6.8.2|

[GHC] #2303: unicode: nko characters can't be used in string literals

2008-05-21 Thread GHC
#2303: unicode: nko characters can't be used in string literals +--- Reporter: guest| Owner: Type: bug | Status: new Priority: normal | Component:

[GHC] #2304: unicode digits misparsed in escape sequences

2008-05-21 Thread GHC
#2304: unicode digits misparsed in escape sequences +--- Reporter: guest| Owner: Type: bug | Status: new Priority: normal | Component: Compiler

Re: [GHC] #1061: default class methods can be given too general a type as GHC tries to share them between instances

2008-05-21 Thread GHC
#1061: default class methods can be given too general a type as GHC tries to share them between instances --+- Reporter: igloo | Owner: igloo Type: merge | Status: closed Priority:

Re: [GHC] #2300: GHCi locks up on long input

2008-05-21 Thread GHC
#2300: GHCi locks up on long input +--- Reporter: ajd |Owner: Type: bug | Status: new Priority: normal |Milestone: Component: GHCi | Version:

how do I abstract this pattern ?

2008-05-21 Thread HP Wei
Suppose p1, p2, p3 are 3 predicates that take an input -- say, a String. They return either (True, result) or False. I want to get an effect like in this expression: case p1 s of (True, r) - r False - case p2 s of (True, r) - r False - case

ghc compiler --- ld -R ?

2008-05-21 Thread HP Wei
In the linker ld, there is a -R option to encode lib-search-directories into the object file. Can we not do that in compiling this ghc -o foo --make foo.hs ??? Thanks HP ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: how do I abstract this pattern ?

2008-05-21 Thread Bulat Ziganshin
Hello HP, Wednesday, May 21, 2008, 8:11:56 PM, you wrote: Suppose p1, p2, p3 are 3 predicates that take an input -- say, a String. They return either (True, result) or False. impossible because these are different types :)) if they return Just result or Nothing - yes, use

Re: ghc compiler --- ld -R ?

2008-05-21 Thread Bulat Ziganshin
Hello HP, Wednesday, May 21, 2008, 8:21:01 PM, you wrote: In the linker ld, there is a -R option example of passing option to ld: ghc ... -optl-Xlinker -optl--large-address-aware -optl-Xlinker may be optional -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re: how do I abstract this pattern ?

2008-05-21 Thread Daniel Fischer
Am Mittwoch, 21. Mai 2008 18:31 schrieb Bulat Ziganshin: Hello HP, Wednesday, May 21, 2008, 8:11:56 PM, you wrote: Suppose p1, p2, p3 are 3 predicates that take an input -- say, a String. They return either (True, result) or False. impossible because these are

Re: how do I abstract this pattern ?

2008-05-21 Thread C.M.Brown
On Wed, 21 May 2008, HP Wei wrote: Suppose p1, p2, p3 are 3 predicates that take an input -- say, a String. They return either (True, result) or False. I want to get an effect like in this expression: case p1 s of (True, r) - r False - case p2 s of

Re: how do I abstract this pattern ?

2008-05-21 Thread C.M.Brown
On further thought, better to use the Maybe afterall. You can use Nothing to signify your False and Just to signify your result. case p1 s of Just result - result Nothing - case p2 s of ... That's probably more intuitive to what you were intending. Chris. On Wed, 21 May 2008, C.M.Brown

Re: how do I abstract this pattern ?

2008-05-21 Thread HP Wei
Thanks to all who has replied in such a short time. From your reponses, I looked at the definition of `mplus` Nothing `mplus` ys = ys xs `mplus` _ = xs It catches the essence of what I am trying to do! Later, if pn grows in number, I can scale up by using some-kind-of-zero with

Re: how do I abstract this pattern ?

2008-05-21 Thread Brandon S. Allbery KF8NH
On 2008 May 21, at 12:31, Bulat Ziganshin wrote: Wednesday, May 21, 2008, 8:11:56 PM, you wrote: Suppose p1, p2, p3 are 3 predicates that take an input -- say, a String. They return either (True, result) or False. if they return Just result or Nothing - yes, use Maybe as

[Haskell] CfP: FDPE 2008

2008-05-21 Thread Michael Hanus
== Call for Papers Functional and Declarative Programming in Education (FDPE08) http://www-ps.informatik.uni-kiel.de/fdpe08/ Victoria, BC, Canada, 21

Re: [Haskell-cafe] ghc-pkg package.conf files?

2008-05-21 Thread Brandon S. Allbery KF8NH
On 2008 May 21, at 1:37, Galchin, Vasili wrote: I fairly innocuous question ;^). How does ghc-pkg know where are the *package.conf files are located? The installed ghc-pkg is a shell script, to wit: #!/bin/sh GHCPKGBIN=/usr/local/lib/ghc-6.8.2/ghc-pkg.bin

Re: [Haskell-cafe] ghc-pkg package.conf files?

2008-05-21 Thread Galchin, Vasili
hmm ... ;^). I found and read through part of ghc-pkg.hs .. ghc-6.8.2/utils/ghc-pkg/ .. I have 6 broken Haskell package databases (not debian) under /usr/lib/haskell-packages/ghc6/lib/. When I run ghc-pkg on them I get [EMAIL PROTECTED]:/usr/lib/haskell-packages/ghc6/lib/cairo-0.9.12.1$ ghc-pkg

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Thomas Hartman
I would be interested in seeing good motivating examples for use of the state monad, other than that example from All About Monads. Okay, it's good for randomness. What else? Reading the source code for State, I think I saw an example about using state to uniquely label elements of a tree with

Re: [Haskell-cafe] Rotating backdrop (aka learning Haskell)

2008-05-21 Thread Yann Golanski
Quoth Derek Elkins on Tue, May 20, 2008 at 11:45:57 -0500 On Tue, 2008-05-20 at 10:55 +0200, Ketil Malde wrote: Yann Golanski [EMAIL PROTECTED] writes: 1- Get a list out of a file: I managed to do that using the following: parseImageFile :: FilePath - IO [String] parseImageFile

RE: [Haskell-cafe] RealFloat constraint on Complex type

2008-05-21 Thread Bayley, Alistair
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard A. O'Keefe On 21 May 2008, at 9:25 am, Conal Elliott wrote: I think the practice of constraint in type definitions is generally discouraged, Is this true? If so, why? If I have a data type that simply

[Haskell-cafe] Re: HaXml and the XHTML 1.0 Strict DTD

2008-05-21 Thread Peter Gammie
On 30/04/2008, at 5:32 PM, Malcolm Wallace wrote: Peter Gammie [EMAIL PROTECTED] wrote: The most-recent darcs version relies on a newer ByteString than I have, so it is not easy for me to test it. I believe there was a patch to fix this. Apparently only one version of the bytestring

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Yitzchak Gale
Thomas Hartman wrote: I would be interested in seeing good motivating examples for use of the state monad... Okay, it's good for randomness. What else? ...I saw an example about using state to uniquely label elements of a tree So, are there any other simple motivating examples that show what

[Haskell-cafe] Re: HaXml and the XHTML 1.0 Strict DTD

2008-05-21 Thread Malcolm Wallace
Peter Gammie [EMAIL PROTECTED] wrote: !ELEMENT table (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+)) Using a slightly hacked HaXml v1.13.3, I get this from DtdToHaskell: data Table = Table Table_Attrs (Maybe Caption) (OneOf2 [Col] [Colgroup]) (Maybe

[Haskell-cafe] Re: HaXml and the XHTML 1.0 Strict DTD

2008-05-21 Thread Peter Gammie
On 21/05/2008, at 5:44 PM, Malcolm Wallace wrote: Peter Gammie [EMAIL PROTECTED] wrote: !ELEMENT table (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+)) Using a slightly hacked HaXml v1.13.3, I get this from DtdToHaskell: data Table = Table Table_Attrs (Maybe Caption)

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Dmitri O.Kondratiev
Thanks everybody for your help! Oliver, you provided an excellent write-up on State monad without going into 'scary' :) details, great work indeed! Alas, in this case I need the details, and in particular the most scary ones! So let's start with fundamental and most intriguing (to me)

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Olivier Boudry
On Wed, May 21, 2008 at 8:42 AM, Dmitri O.Kondratiev [EMAIL PROTECTED] wrote: So let's start with fundamental and most intriguing (to me) things: getAny :: (Random a) = State StdGen a getAny = do g - get -- magically get the current StdGen First line above declares a data type: State

Re: [Haskell-cafe] ghc-pkg package.conf files?

2008-05-21 Thread Brandon S. Allbery KF8NH
On 2008 May 21, at 2:35, Galchin, Vasili wrote: hmm ... ;^). I found and read through part of ghc-pkg.hs .. ghc-6.8.2/utils/ghc-pkg/ .. I have 6 broken Haskell package databases (not debian) under /usr/lib/haskell-packages/ghc6/lib/. When I run ghc-pkg on them I get [EMAIL

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Jules Bean
Dmitri O.Kondratiev wrote: Thanks everybody for your help! Oliver, you provided an excellent write-up on State monad without going into 'scary' :) details, great work indeed! Alas, in this case I need the details, and in particular the most scary ones! So let's start with fundamental

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Dmitri O.Kondratiev
State is a data type. As any other data type it can be instantiated. State instance is a structure of one record that contains (\s -(a,s)) lambda function. This function can be parametrized by types of its arguments 's' and 'a'. I don't see magic here :) Ok, then from declaration: getAny ::

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Dmitri O.Kondratiev
Jules, Stupid question, please bear with me: x :: Int -- x declared, but not constructed x = 1 -- x constructed s1 :: State StdGen a -- s1 declared, yes, but why s1 is *also already constructed* ? On Wed, May 21, 2008 at 6:54 PM, Jules Bean [EMAIL PROTECTED] wrote: Dmitri O.Kondratiev wrote:

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Jules Bean
Dmitri O.Kondratiev wrote: Jules, Stupid question, please bear with me: x :: Int -- x declared, but not constructed x = 1 -- x constructed s1 :: State StdGen a -- s1 declared, yes, but why s1 is *also already constructed* ? it's not. it's constructed when you do s1 = return 1 ... or ...

[Haskell-cafe] Return user state in Parsec

2008-05-21 Thread Maciej Podgurski
Hi, I'm currently writing a parser using the Parsec library. What I want is to store the order of each subparser called in a user state. So every single parser will be marked with a label that is stored in a special treelike structure when the parser is run. My problem is to return the last

RE: [Haskell-cafe] [Solved] Installing Cabal-Install

2008-05-21 Thread Aditya Siram
That worked. Thank you. Date: Wed, 21 May 2008 12:22:33 -0400 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [Haskell-cafe] Installing Cabal-Install CC: haskell-cafe@haskell.org On Wed, May 21, 2008 at 12:11 PM, Aditya Siram wrote:

[Haskell-cafe] Re: Return user state in Parsec

2008-05-21 Thread Achim Schneider
Maciej Podgurski [EMAIL PROTECTED] wrote: Hi, I'm currently writing a parser using the Parsec library. What I want is to store the order of each subparser called in a user state. So every single parser will be marked with a label that is stored in a special treelike structure when the

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Dan Weston
Dan Doel wrote: On Tuesday 20 May 2008, [EMAIL PROTECTED] wrote: Actually, it's true less than 50% of the time. In particular, it's not true of any monad transformer. Sure it is. Any particular transformer t typically comes with some particular way of writing a function of type t m a - m a

Re: [Haskell-cafe] MD5 performance optimizations

2008-05-21 Thread Andrew Coppin
Woo! Salvatore kindly sent me a Darcs patch, and applying it does indeed make it run faster. Yay! [Note that -fvia-c works just fine for me. It doesn't appear to produce a huge speed difference, but it compiles just fine.] Thanks for the tips, guys! :-D The changes are in the online Darcs

Re: [Haskell-cafe] MD5 performance optimizations

2008-05-21 Thread Salvatore Insalaco
2008/5/21 Andrew Coppin [EMAIL PROTECTED]: Woo! Salvatore kindly sent me a Darcs patch, and applying it does indeed make it run faster. Yay! Hi Andrew, I'm glad that -fvia-c works for you: maybe it's a Mac OS X specific bug? Anyway, did you compile with -fvia-c -optc-O3? I expect

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Dmitri O.Kondratiev
-- Jules, Oliver, thanks! Things are getting clarified, I hope. -- Let me summarize how I now understand getAny operation, please correct me if I am wrong. getAny :: (Random a) = State StdGen a getAny = do g - get (x,g') - return $ random g put g' return x {--

[Haskell-cafe] Ubuntu and ghc

2008-05-21 Thread Galchin, Vasili
Hello, https://bugs.launchpad.net/ubuntu/+source/gtk2hs/+bug/229489 this is almost identical to my problem. I am just trying to help others on this list who are using Ubuntu Linux to avoid my predicament! Kind regards, Vasili ___

Re: [Haskell-cafe] Ubuntu and ghc

2008-05-21 Thread Dan Weston
Now you tell me! I also upgraded late last night and got the exact same problem. :( I just uninstalled the ghc from the Update Manager and was going to reinstall tonight. Are you saying that something else is screwed up because of this? Galchin, Vasili wrote: Hello,

Re: [Haskell-cafe] Ubuntu and ghc

2008-05-21 Thread Galchin, Vasili
Hi Dan, I am still looking into this myself. I just stumbled across the URL below. i would suggest keeping an eye on this URL for more news. Vasili On Wed, May 21, 2008 at 5:45 PM, Dan Weston [EMAIL PROTECTED] wrote: Now you tell me! I also upgraded late last night and got the exact same

[Haskell-cafe] relational data representation in memory using haskell?

2008-05-21 Thread Marc Weber
I'm kind of stuck that's why I'm posting here to ask wether this makes sense at all, maybe someone else has already done it? What I'd like to have: Some way representing relational data which is typically stored in databases such as Postgresql.. Rewriting something like Postgresql in haskell

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Lennart Augustsson
I certainly don't use 50% IO monads. I regard any use of the IO monad except at the top level as a failure. :) On Wed, May 21, 2008 at 7:14 PM, Dan Weston [EMAIL PROTECTED] wrote: Dan Doel wrote: On Tuesday 20 May 2008, [EMAIL PROTECTED] wrote: Actually, it's true less than 50% of the time.

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Don Stewart
lennart: I certainly don't use 50% IO monads. I regard any use of the IO monad except at the top level as a failure. :) IO fail -- Don Background: http://failblog.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Dan Piponi
On Wed, May 21, 2008 at 4:08 PM, Lennart Augustsson [EMAIL PROTECTED] wrote: I certainly don't use 50% IO monads. I regard any use of the IO monad except at the top level as a failure. :) Real Haskell Programmers Only Use Top Level IO! (But then again, real programmers wouldn't use Haskell:

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Neil Mitchell
Hi Real Haskell Programmers Only Use Top Level IO! (But then again, real programmers wouldn't use Haskell: http://www.pbm.com/~lindahl/real.programmers.html) It's amazing how many phone interviews I've done where the HR person at the other end tries to tick the knows Pascal box, despite me

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Creighton Hogg
On Wed, May 21, 2008 at 6:37 PM, Neil Mitchell [EMAIL PROTECTED] wrote: Hi Real Haskell Programmers Only Use Top Level IO! (But then again, real programmers wouldn't use Haskell: http://www.pbm.com/~lindahl/real.programmers.htmlhttp://www.pbm.com/%7Elindahl/real.programmers.html )

Re: [Haskell-cafe] relational data representation in memory using haskell?

2008-05-21 Thread Marc Weber
On Wed, May 21, 2008 at 05:05:21PM -0700, Jeremy Shaw wrote: At Thu, 22 May 2008 01:04:24 +0200, Marc Weber wrote: Some way representing relational data which is typically stored in databases such as Postgresql.. Rewriting something like Postgresql in haskell would take ages.. So

Re: [Haskell-cafe] relational data representation in memory using haskell?

2008-05-21 Thread Dan Weston
Consider SQLite [1], which is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. It is embeddable, can reside completely in memory (including the data), and can be saved and restored to disk when needed. It neatly fills the