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