Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread John Dorsey
Tim, > > A year or two ago, ISTR that *most* of the newbie-generated traffic in > > the cafe was about atrocious performance of naive programs due to > > strict/lazy concerns. I think it was scaring people away. > > I think it's debatable what the various causality relationships might be here

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Tim Chevalier
On 9/4/08, John Dorsey <[EMAIL PROTECTED]> wrote: > I'm no master either, but I'd argue that if we promise new programmers > that they don't need to care about strictness, we thereby ensure that > default laziness is treacherous. > > A year or two ago, ISTR that *most* of the newbie-generated tr

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 5, 2008, at 12:45 AM, Tim Chevalier wrote: On 9/4/08, Jake Mcarthur <[EMAIL PROTECTED]> wrote: Two lazy algorithms tend to compose well and result in a lazy algorithm. A lazy algorithm can compose with a strict algorithm in two different ways. One way is for the lazy algorithm to cont

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Tim Chevalier
On 9/4/08, Jake Mcarthur <[EMAIL PROTECTED]> wrote: > Two lazy algorithms tend to compose well and result in a lazy > algorithm. A lazy algorithm can compose with a strict algorithm in two > different ways. One way is for the lazy algorithm to control the > strict algorithm, in which case the

[Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-04 Thread Ashley Yakeley
Sittampalam, Ganesh wrote: Oh dear. To fix this, I suppose the RTS would have to be able to keep track of all static initialisers. But it shouldn't otherwise affect program optimisation. What would the RTS actually do? I don't know enough about the RTS to say. I imagine initialisers would ha

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread John Dorsey
Tim Chevalier wrote: > I'm no master, but I've never encountered a situation where strictness > annotations would be useful as documentation, nor can I imagine one. > That's because optimization *is* the only reason why programmers > should care about strictness information. IMO, arguing that > pro

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 4, 2008, at 11:40 PM, Tim Chevalier wrote: But why not write your types like: data Stream a = Cons a data Vector3 a = Vector3 a a a in a hypothetical call-by-value language where the <> annotation denotes a lazily evaluated data structure? Does it matter? If it does, th

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread wren ng thornton
minh thu wrote: 2008/9/4 Paul Johnson <[EMAIL PROTECTED]>: I'd have thought you wanted "IORef (Maybe Thing)", which says that the pointer always exists, but may not point to anything. On the other hand "Maybe (IORef Thing)" says that the pointer may or may not exist. Yes, someone else said it

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread Jake Mcarthur
On Sep 4, 2008, at 12:50 PM, minh thu wrote: I'd have thought you wanted "IORef (Maybe Thing)", which says that the pointer always exists, but may not point to anything. On the other hand "Maybe (IORef Thing)" says that the pointer may or may not exist. Yes, someone else said it too. But

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Tim Chevalier
On 9/4/08, Jake Mcarthur <[EMAIL PROTECTED]> wrote: > I'm no master either, but how about these simple examples? > > data Stream a = Cons !a (Stream a) > data Vector3 a = Vector3 !a !a !a > > The compiler will certainly be able to infer the strictness itself in > most uses, so ob

The IO sin bin [was: Re: [Haskell-cafe] Re: [Haskell] Top Level <-]

2008-09-04 Thread wren ng thornton
Adrian Hey wrote: There's shed loads of information and semantic subtleties about pretty much any operation you care to think of in the IO monad that isn't communicated by it's type. All you know for sure is that it's weird, because if it wasn't it wouldn't be in the IO monad. So I think you're

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 4, 2008, at 11:23 PM, Jake Mcarthur wrote: To quote a blog article[1] I wrote in June, And of course I would forget to link the article. My bad. [1] http://geekrant.wordpress.com/2008/06/23/misconceptions/ - Jake McArthur ___ Haskell-Cafe ma

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 4, 2008, at 9:52 PM, Tim Chevalier wrote: I'm no master, but I've never encountered a situation where strictness annotations would be useful as documentation, nor can I imagine one. I'm no master either, but how about these simple examples? data Stream a = Cons !a (Stream a

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Tim Chevalier
On 9/4/08, Jake Mcarthur <[EMAIL PROTECTED]> wrote: > My guess would be that a master usually adds strictness annotations as > documentation rather than as optimizations. > I'm no master, but I've never encountered a situation where strictness annotations would be useful as documentation, nor can

Re: [Haskell-cafe] Functional references

2008-09-04 Thread Ryan Ingram
Nice. I've written similar stuff a couple of times before, but the formulation using Maybe and modify definitely solves some problems I started to notice as I used it on bigger structures. However, it might be better to separate a class of "never failing" references, where the reader is guarantee

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-04 Thread Brandon S. Allbery KF8NH
On 2008 Sep 4, at 20:08, David Menendez wrote: What happens when you upgrade GHC? The problem MacPorts has is that the libraries are still listed as installed, even though they are no longer registered or useable. MacPorts has the same problem with Perl (XS code is dependent on the exact ver

Re: [Haskell-cafe] Categorical language

2008-09-04 Thread Matt Hellige
On Thu, Sep 4, 2008 at 1:46 PM, Pierre-Evariste Dagand <[EMAIL PROTECTED]> wrote: >> what could be a "categorical language"? > > Something we would call Charity, for example :-) > Also check out Tatsuya Hagino's PhD thesis, available here: http://www.tom.sfc.keio.ac.jp/~hagino/index.html.en It'

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 4, 2008, at 10:19 AM, Tim Chevalier wrote: The master programmer does not add strictness annotations, for she has not yet run the profiler. My guess would be that a master usually adds strictness annotations as documentation rather than as optimizations. - Jake McArthur _

Re: [Haskell-cafe] Linux version of ghc-6.8.3 won't intall or run for me: "Floating point exception".

2008-09-04 Thread Bryan O'Sullivan
On Thu, Sep 4, 2008 at 2:24 PM, Don Stewart <[EMAIL PROTECTED]> wrote: >> I've downloaded the ghc-6.8.3-i386-unknown-linux.tar.bz2 tarball, which >> I expected to work on my GNU/Linux box (1.2 GHz Athlon, Debian Sarge). > > Was there a problem installing GHC from the Debian package system with apt

Re: [Haskell-cafe] Consequences of implementing a library in Haskell for C consumption?

2008-09-04 Thread Austin Seipp
Excerpts from Justin Bailey's message of Thu Sep 04 17:00:58 -0500 2008: > Looking at the package, I think would be pretty painful though. It > seems I'd have to build the AST by hand, The AST Language.C defines for C is actually fairly regular once you wrap your head around it - I got it to gene

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-04 Thread Duncan Coutts
On Thu, 2008-09-04 at 20:08 -0400, David Menendez wrote: > On Thu, Sep 4, 2008 at 4:14 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > > That's right, on Arch we just go for what people actually need, i.e.: > > > >1) 1 compiler, GHC > >2) GHC comes with the core+extra set, so they're implicitl

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-04 Thread Don Stewart
dave: > On Thu, Sep 4, 2008 at 4:14 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > > That's right, on Arch we just go for what people actually need, i.e.: > > > >1) 1 compiler, GHC > >2) GHC comes with the core+extra set, so they're implicitly available > >3) all other libs are "haskell-(

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-04 Thread David Menendez
On Thu, Sep 4, 2008 at 4:14 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > That's right, on Arch we just go for what people actually need, i.e.: > >1) 1 compiler, GHC >2) GHC comes with the core+extra set, so they're implicitly available >3) all other libs are "haskell-(map toLower packag

[Haskell-cafe] Functional references

2008-09-04 Thread Tim Newsham
I'm playing with functional references and looking for some feedback on a small FRec library I put together: http://www.thenewsh.com/~newsham/FRef.hs Novel (I think) is that the library is applied to some data accesses that are not normally covered by functional references -- ie. extracting

[Haskell-cafe] Re: Hackage -> MacPorts?

2008-09-04 Thread Aaron Denney
On 2008-09-04, Don Stewart <[EMAIL PROTECTED]> wrote: > The complication to support multiple implementations et al isn't done by > any other language group (i.e. libs aren't bundled for multiple python > impls, or different C compilers), so I don't see why we should waste > time on that either. Pra

Re: [Haskell-cafe] Linux version of ghc-6.8.3 won't intall or run for me: "Floating point exception".

2008-09-04 Thread Alan Mackenzie
Hi, Don! On Thu, Sep 04, 2008 at 02:24:20PM -0700, Don Stewart wrote: > acm: > > Hi, Haskell! > > I've downloaded the ghc-6.8.3-i386-unknown-linux.tar.bz2 tarball, > > which I expected to work on my GNU/Linux box (1.2 GHz Athlon, Debian > > Sarge). > Was there a problem installing GHC from the D

Re: [Haskell-cafe] Consequences of implementing a library in Haskell for C consumption?

2008-09-04 Thread Brandon S. Allbery KF8NH
On 2008 Sep 4, at 18:00, Justin Bailey wrote: On Thu, Sep 4, 2008 at 2:52 PM, Philippa Cowderoy <[EMAIL PROTECTED]> wrote: Would writing Haskell to generate the C via Language.C be an option? Effectively you'd be using Haskell as a typeful macro system. Interesting idea, and I've done similar

Re: [Haskell-cafe] Consequences of implementing a library in Haskell for C consumption?

2008-09-04 Thread Justin Bailey
On Thu, Sep 4, 2008 at 2:52 PM, Philippa Cowderoy <[EMAIL PROTECTED]> wrote: > Would writing Haskell to generate the C via Language.C be an option? > Effectively you'd be using Haskell as a typeful macro system. Interesting idea, and I've done similar things with haskelldb (generating SQL queries

Re: [Haskell-cafe] Linux version of ghc-6.8.3 won't intall or run for me: "Floating point exception".

2008-09-04 Thread Alan Mackenzie
HI THERE, JOHANNES, what a surprise, how are you doing? Remember teaching me the 7-ring 1-count? Might've been at Erlangen, possibly Augsburg, even Berlin, but it was quite a while ago. :-) On Thu, Sep 04, 2008 at 11:20:35PM +0200, Johannes Waldmann wrote: > Hi, Alan - > >./configure fails wit

Re: [Haskell-cafe] Consequences of implementing a library in Haskell for C consumption?

2008-09-04 Thread Don Stewart
jgbailey: > I am thinking of writing a simple library in Haskell which would be > useful in a number of different scenarios, and not always with > programs written in Haskell. That makes me think the library should be > C-compatible and able to link with C programs. Reading over chapter 9 > of the

Re: [Haskell-cafe] Parsec 3 Description

2008-09-04 Thread Philippa Cowderoy
On Thu, 2008-09-04 at 20:38 +, Duncan Coutts wrote: > On Thu, 2008-09-04 at 19:41 +0100, Philippa Cowderoy wrote: > > On Thu, 4 Sep 2008, John Van Enk wrote: > > > > > I'm looking for a document describing the differences between Parsec 3 and > > > Parsec 2. My google-foo must be off because I

[Haskell-cafe] Consequences of implementing a library in Haskell for C consumption?

2008-09-04 Thread Justin Bailey
I am thinking of writing a simple library in Haskell which would be useful in a number of different scenarios, and not always with programs written in Haskell. That makes me think the library should be C-compatible and able to link with C programs. Reading over chapter 9 of the GHC manual ("Foreign

Re: [Haskell-cafe] Linux version of ghc-6.8.3 won't intall or run for me: "Floating point exception".

2008-09-04 Thread Johannes Waldmann
Was there a problem installing GHC from the Debian package system with apt? He said Sarge. I guess the current ghc packages are for Etch only? - J.W. signature.asc Description: OpenPGP digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@h

Re: [Haskell-cafe] Linux version of ghc-6.8.3 won't intall or run for me: "Floating point exception".

2008-09-04 Thread Ian Lynagh
On Thu, Sep 04, 2008 at 11:20:35PM +0200, Johannes Waldmann wrote: > > >./configure fails with "checking for path to top of build tree... > >configure: error: cannot determine current directory". > > I guess the 6.8.3 binary does not work because it expects a newer > version of libc or whatever.

Re: [Haskell-cafe] Linux version of ghc-6.8.3 won't intall or run for me: "Floating point exception".

2008-09-04 Thread Don Stewart
acm: > Hi, Haskell! > > I've downloaded the ghc-6.8.3-i386-unknown-linux.tar.bz2 tarball, which > I expected to work on my GNU/Linux box (1.2 GHz Athlon, Debian Sarge). Was there a problem installing GHC from the Debian package system with apt? -- Don

Re: [Haskell-cafe] Linux version of ghc-6.8.3 won't intall or run for me: "Floating point exception".

2008-09-04 Thread Johannes Waldmann
Hi, Alan - ./configure fails with "checking for path to top of build tree... configure: error: cannot determine current directory". Yeah, I got the exact same error yesterday when trying to install a ghc-6.8.3 binary dist on some older machine. Well, since I had 6.8.2 working there, I just u

[Haskell-cafe] Linux version of ghc-6.8.3 won't intall or run for me: "Floating point exception".

2008-09-04 Thread Alan Mackenzie
Hi, Haskell! I've downloaded the ghc-6.8.3-i386-unknown-linux.tar.bz2 tarball, which I expected to work on my GNU/Linux box (1.2 GHz Athlon, Debian Sarge). I'm new at this game, though I'm thoroughly experienced with (and bear deep battle scars from) GNU software in general. ./configure fails wi

Re: [Haskell-cafe] Parsec 3 Description

2008-09-04 Thread Duncan Coutts
On Thu, 2008-09-04 at 19:41 +0100, Philippa Cowderoy wrote: > On Thu, 4 Sep 2008, John Van Enk wrote: > > > I'm looking for a document describing the differences between Parsec 3 and > > Parsec 2. My google-foo must be off because I can't seem to find one. Does > > any one know where to find that

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-04 Thread Don Stewart
duncan.coutts: > On Thu, 2008-09-04 at 12:09 -0400, David Menendez wrote: > > On Thu, Sep 4, 2008 at 5:19 AM, Duncan Coutts > > <[EMAIL PROTECTED]> wrote: > > > That's exactly the same situation as with Gentoo. We provide a > > > ghc-updater program that re-installs all the existing libs for the ne

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-04 Thread Duncan Coutts
On Thu, 2008-09-04 at 12:09 -0400, David Menendez wrote: > On Thu, Sep 4, 2008 at 5:19 AM, Duncan Coutts > <[EMAIL PROTECTED]> wrote: > > That's exactly the same situation as with Gentoo. We provide a > > ghc-updater program that re-installs all the existing libs for the new > > ghc. Gentoo also on

Re: [Haskell-cafe] Compiler's bane

2008-09-04 Thread Ryan Ingram
On Thu, Sep 4, 2008 at 10:41 AM, Andrew Coppin <[EMAIL PROTECTED]> wrote: > I love the way other people have wildly different ideas of "simple" than me. > I'm staring at this and completely failing to comprehend it. (But then, > anything with "co" in the name generally makes little sense to me...)

Re: [Haskell-cafe] Categorical language

2008-09-04 Thread Bill
On Thu, 2008-09-04 at 20:46 +0200, Pierre-Evariste Dagand wrote: > > what could be a "categorical language"? > > Something we would call Charity, for example :-) > > http://en.wikipedia.org/wiki/Charity_(programming_language) > http://pll.cpsc.ucalgary.ca/charity1/www/home.html > > Also, there h

Re: [Haskell-cafe] Parsec 3 Description

2008-09-04 Thread John Van Enk
While an incompatibility list would be good, a descriptive change-log with new feature examples would be nice. On Thu, Sep 4, 2008 at 2:41 PM, Philippa Cowderoy <[EMAIL PROTECTED]>wrote: > On Thu, 4 Sep 2008, John Van Enk wrote: > > > I'm looking for a document describing the differences between

Re: [Haskell-cafe] Categorical language

2008-09-04 Thread Pierre-Evariste Dagand
> what could be a "categorical language"? Something we would call Charity, for example :-) http://en.wikipedia.org/wiki/Charity_(programming_language) http://pll.cpsc.ucalgary.ca/charity1/www/home.html Also, there has been/is some work on Squiggol and the Algebra of Programming that relies on ca

Re: [Haskell-cafe] Parsec 3 Description

2008-09-04 Thread Philippa Cowderoy
On Thu, 4 Sep 2008, John Van Enk wrote: > I'm looking for a document describing the differences between Parsec 3 and > Parsec 2. My google-foo must be off because I can't seem to find one. Does > any one know where to find that information? > Unfortunately there isn't currently a good one - in f

Re: [Haskell-cafe] Compiler's bane

2008-09-04 Thread Brandon S. Allbery KF8NH
On Sep 4, 2008, at 13:41 , Andrew Coppin wrote: Ryan Ingram wrote: It's pretty simple, I think. type ExpGen = ReaderT [String] Gen arbExp :: ExpGen Expression -- exercise for the reader instance Arbitrary Expression where arbitrary = runReaderT arbExp [] coarbitrary = coarbExp coarbExp

Re: [Haskell-cafe] Compiler's bane

2008-09-04 Thread Jonathan Cast
On Thu, 2008-09-04 at 18:41 +0100, Andrew Coppin wrote: > Ryan Ingram wrote: > > It's pretty simple, I think. > > > > type ExpGen = ReaderT [String] Gen > > > > arbExp :: ExpGen Expression > > -- exercise for the reader > > > > instance Arbitrary Expression where > > arbitrary = runReaderT arbE

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread minh thu
2008/9/4 Paul Johnson <[EMAIL PROTECTED]>: > minh thu wrote: >> >> Do you suggest I use >> >> data Thing = Thing | None >> >> and IORef Thing instead of >> >> data Thing = Thing >> >> and Maybe (IORef Thing) ? >> >> I'm writing a data structure that can hold Things (and that can be >> mutated) or

[Haskell-cafe] Parsec 3 Description

2008-09-04 Thread John Van Enk
I'm looking for a document describing the differences between Parsec 3 and Parsec 2. My google-foo must be off because I can't seem to find one. Does any one know where to find that information? -- /jve ___ Haskell-Cafe mailing list Haskell-Cafe@haskell

Re: [Haskell-cafe] Compiler's bane

2008-09-04 Thread Andrew Coppin
Ryan Ingram wrote: It's pretty simple, I think. type ExpGen = ReaderT [String] Gen arbExp :: ExpGen Expression -- exercise for the reader instance Arbitrary Expression where arbitrary = runReaderT arbExp [] coarbitrary = coarbExp coarbExp (Var s) = variant 0 . coarbitrary s coarb

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread Paul Johnson
minh thu wrote: Do you suggest I use data Thing = Thing | None and IORef Thing instead of data Thing = Thing and Maybe (IORef Thing) ? I'm writing a data structure that can hold Things (and that can be mutated) or nothing (there is a hole in the wrapping data). I'd have thought you wan

Re: [Haskell-cafe] Compiler's bane

2008-09-04 Thread Andrew Coppin
Brandon S. Allbery KF8NH wrote: On 2008 Sep 3, at 14:34, Andrew Coppin wrote: The amusing (?) part is that the interpretter itself is essentially quite simple. I've implemented it several times before now. But what I'm trying to do it make it print out elaborately formatted execution traces so

[Haskell-cafe] [POPL logo design contest]

2008-09-04 Thread Don Stewart
This sounds relevant to our interests... - Forwarded message from Swarat Chaudhuri <[EMAIL PROTECTED]> - Date: Thu, 04 Sep 2008 09:13:55 -0400 From: Swarat Chaudhuri <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [TYPES] POPL logo design contest [ The Types Forum, http://lists.seas.u

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-04 Thread Ian Lynagh
On Thu, Sep 04, 2008 at 12:09:33PM -0400, David Menendez wrote: > > Does anyone know whether arch linux and debian can handle multiple > Haskell environments? Debian currently only handles one version of GHC (but package dependencies mean that you can't end up with libraries compiled for the wron

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-04 Thread David Menendez
On Thu, Sep 4, 2008 at 5:19 AM, Duncan Coutts <[EMAIL PROTECTED]> wrote: > On Wed, 2008-09-03 at 17:54 -0400, David Menendez wrote: >> In my experience thus far, MacPorts feels like a poor match for Cabal. >> As far as I can tell, you get at most one active installation of a >> given port, which me

[Haskell-cafe] Categorical language

2008-09-04 Thread Maurí­cio
Hi, I’ve been thinking about this and would like your opinion: what could be a “categorical language”? Something like a language where categories and functors are first class; does that makes sense at all? (Sorry if this is insane, I'm a begginer in categories, I've read just the first chapter of

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Tim Chevalier
On 9/3/08, wren ng thornton <[EMAIL PROTECTED]> wrote: > If you want the datatype to be strict in state and rec, then you should add > strictness annotations to those fields directly: > > data Query state rec = Query !state !rec The novice programmer scatters strictness annotations to and fro

[Haskell-cafe] RE: [Haskell] Top Level <-

2008-09-04 Thread Sittampalam, Ganesh
Ashley Yakeley wrote: > Sittampalam, Ganesh wrote: > > I talked to Don about this and you're right, that doesn't happen. > > However > > he also confirmed that it does load modules a second time if they are > > in the main program as well as the plugin, and it would be difficult > > to merge the

[Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-04 Thread Ashley Yakeley
Sittampalam, Ganesh wrote: I talked to Don about this and you're right, that doesn't happen. However he also confirmed that it does load modules a second time if they are in the main program as well as the plugin, and it would be difficult to merge the static and dynamic versions of the module.

Re: [Haskell-cafe] Haskell and i18n (aka gettext) support

2008-09-04 Thread Duncan Coutts
On Thu, 2008-09-04 at 06:53 +0200, Gour wrote: > As potential 'solution the 'i18n' package was mentioned > (http://hackage.haskell.org/cgi-bin/hackage-scripts/package/i18n) with > the remark that its API is not the most beautiful. Seems to me that this is a good use case for implicit parameters,

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-04 Thread Duncan Coutts
On Wed, 2008-09-03 at 17:54 -0400, David Menendez wrote: > On Wed, Sep 3, 2008 at 4:14 PM, John MacFarlane <[EMAIL PROTECTED]> wrote: > > It would be great if there were an automated or semi-automated way > > of generating a MacPorts Portfile from a HackageDB package, along > > the lines of dons' c

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread minh thu
2008/9/4 Lennart Augustsson <[EMAIL PROTECTED]>: > I would represent the data structure in a pure way, and restrict the > IO monad to the operations that actually do IO. > If you need some kind of mutable graph, I suggest representing that > graph as a map (Data.Map) from node names to neighbors. >

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread Lennart Augustsson
I would represent the data structure in a pure way, and restrict the IO monad to the operations that actually do IO. If you need some kind of mutable graph, I suggest representing that graph as a map (Data.Map) from node names to neighbors. The "mutation" is then just updating the map. An extra be

[Haskell-cafe] RE: [Haskell] Top Level <-

2008-09-04 Thread Sittampalam, Ganesh
Ashley Yakeley wrote: > Sittampalam, Ganesh wrote: > > In compiled code module boundaries don't necessarily exist. So how do > > you relink the loaded code so that it points to the unique copy of the > > module? > hs-plugins loads modules as single .o files, I believe. Yes, but (a) the loadin

Re: [Haskell-cafe] Is it usual to read a Maybe (IORef a) ?

2008-09-04 Thread minh thu
2008/9/4 Timothy Goddard <[EMAIL PROTECTED]>: > It looks like this code isn't really in fitting with normal Haskell idioms. I guess you mean by Haskell idiom : "pure". But Haskell allows you to do IO, etc. > Emulating C in Haskell will only give you a harder way of writing C. Don't > think about