Re: [Haskell-cafe] Re: Zippers

2009-03-05 Thread Cristiano Paris
On 3/5/09, Ryan Ingram ryani.s...@gmail.com wrote: ... Here is the problem with your update: tree = Fork (Leaf 1) (Leaf 2) ztree = initZ tree test = fromJust $ do z1 - moveLeft ztree let z2 = update z1 3 z3 - moveUp z2 z4 - moveLeft z3 this z4 I'd expect test to equal

Re: [Haskell-cafe] help optimizing memory usage for a program

2009-03-05 Thread Manlio Perillo
Don Stewart ha scritto: manlio_perillo: Hi. After some work I have managed to implement two simple programs that parse the Netflix Prize data set. For details about the Netflix Prize, there was a post by Kenneth Hoste some time ago. I have cabalized the program, and made available

[Haskell-cafe] Re: Zippers

2009-03-05 Thread Heinrich Apfelmus
Cristiano Paris wrote: Ryan Ingram wrote: ... Here is the problem with your update: tree = Fork (Leaf 1) (Leaf 2) ztree = initZ tree test = fromJust $ do z1 - moveLeft ztree let z2 = update z1 3 z3 - moveUp z2 z4 - moveLeft z3 this z4 I'd expect test to equal 3, but I

Re: [Haskell-cafe] monadic MapReduce

2009-03-05 Thread Manlio Perillo
Anish Muttreja ha scritto: [...] How about this. Is there a reason why I can't replace the variables b and c in the type signature of mapReduce with with (IO b') and (IO c'). b and c can be any types. mapReduce :: Strategy (IO b')-- evaluation strategy for mapping - (a - IO

Re: [Haskell-cafe] Re: Zippers

2009-03-05 Thread Cristiano Paris
On Thu, Mar 5, 2009 at 11:21 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: ... Such self-reference is usually called tying the knot, see also  http://www.haskell.org/haskellwiki/Tying_the_Knot I didn't know. Would you call this Tying the knot as well?

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-05 Thread Manlio Perillo
Bulat Ziganshin ha scritto: Hello Manlio, Tuesday, March 3, 2009, 5:35:33 PM, you wrote: There are 100,000,000 ratings, so I create 100,000,000 arrays containing only one element. every array needs ~30 bytes - it's a minimal memory block ghc can alloc for variable-sized objects. multiple

Re: [Haskell-cafe] How to make a dock window for xmonad using gtk2hs?

2009-03-05 Thread Khudyakov Alexey
On Thursday 05 March 2009 09:45:51 Magicloud Magiclouds wrote: I am confused. Code like this works in other WM, except xmonad. You code does not set _NET_WM_STRUT property. And because of that xmonad doesn't treat it specifically. You can inspect you window properties using `xprop' utility.

Re: [Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-05 Thread Neil Mitchell
Hi Gwern, I get String/Data.Binary issues too. My suggestion would be to change your strings to ByteString's, serisalise, and then do the reverse conversion when reading. Interestingly, a String and a ByteString have identical Data.Binary reps, but in my experiments converting, including the cost

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Peter Verswyvelen
Ha. There's even a wiki page on the paradoxes of set theory http://en.wikipedia.org/wiki/Paradoxes_of_set_theory If I recall correctly, a math professor once told me that it is not yet proven if the cardinality of the power set of the natural numbers is larger or smaller or equal than the

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Daniel Fischer
Am Donnerstag, 5. März 2009 13:09 schrieb Peter Verswyvelen: Ha. There's even a wiki page on the paradoxes of set theory http://en.wikipedia.org/wiki/Paradoxes_of_set_theory If I recall correctly, a math professor once told me that it is not yet proven if the cardinality of the power set of

[Haskell-cafe] Finding the Convex Hull (Problem 12 of Real World Haskell)

2009-03-05 Thread Rob Crowther
I wrote a solution to this problem, but it appears to return incorrect results. There's a pastebin of the code at http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2121 and a picture of the inputs, outputs, and expected results graphed at http://img510.imageshack.us/img510/9971/resultsg.jpg I'm

[Haskell-cafe] Re: [Haskell] Lazy IO breaks purity

2009-03-05 Thread Simon Marlow
Lennart Augustsson wrote: I don't see any breaking of referential transparence in your code. Every time you do an IO operation the result is basically non-deterministic since you are talking to the outside world. You're assuming the IO has some kind of semantics that Haskell makes no promises

Re: [Haskell-cafe] How to make a dock window for xmonad using gtk2hs?

2009-03-05 Thread Andrea Rossato
On Wed, Mar 04, 2009 at 10:59:53PM -0500, Brandon S. Allbery KF8NH wrote: On 2009 Mar 4, at 21:40, Magicloud Magiclouds wrote: Could someone give me a sample or something I could learn from? Thanks. (xmobar is open source, you could look through its source) xmobar is not open source. xmobar

Re: [Haskell-cafe] Finding the Convex Hull (Problem 12 of Real World Haskell)

2009-03-05 Thread Andrew Wagner
Whenever I'm looking for a bug in Haskell code, I find it helpful to start by seeing if I can simplify the code any first. In this case, there are a couple of things I notice: - validPointsOf is just a filter. It would be easier to write valid :: MyDirection - Bool and then validPointsOf =

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Hans Aberg
On 5 Mar 2009, at 13:29, Daniel Fischer wrote: In standard NBG set theory, it is easy to prove that card(P(N)) == card(R). No, it is an axiom: Cohen showed in 1963 (mentioned in Mendelson, Introduction to Mathematical Logic) that the continuum hypothesis (CH) is independent of

Re: [Haskell-cafe] Finding the Convex Hull (Problem 12 of Real World Haskell)

2009-03-05 Thread Daniel Fischer
Am Donnerstag, 5. März 2009 13:40 schrieb Rob Crowther: I wrote a solution to this problem, but it appears to return incorrect results. There's a pastebin of the code at http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2121 and a picture of the inputs, outputs, and expected results graphed at

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Daniel Fischer
Am Donnerstag, 5. März 2009 14:58 schrieb Hans Aberg: On 5 Mar 2009, at 13:29, Daniel Fischer wrote: In standard NBG set theory, it is easy to prove that card(P(N)) == card(R). No, it is an axiom: Cohen showed in 1963 (mentioned in Mendelson, Introduction to Mathematical Logic) that the

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Colin Adams
2009/3/5 Hans Aberg hab...@math.su.se: GHC says that for any set x, there are no cardinalities between card x and No it doesn't. It says there is a syntax error in my code. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Daniel Fischer
Am Donnerstag, 5. März 2009 15:12 schrieb Daniel Fischer: Yes, but the continuum hypothesis is 2^Aleph_0 == Aleph_1, which is quite something different from 2^Aleph_0 == card(R). You can show the latter easily with the Cantor-Bernstein theorem, independent of CH or AC. Just to flesh this up

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Hans Aberg
On 5 Mar 2009, at 15:12, Daniel Fischer wrote: No, it is an axiom: Cohen showed in 1963 (mentioned in Mendelson, Introduction to Mathematical Logic) that the continuum hypothesis (CH) is independent of NBG+(AC)+(Axiom of Restriction), where AC is the axiom of choice. Yes, but the continuum

[Haskell-cafe] missing support to Data.Binary for uvector package

2009-03-05 Thread Manlio Perillo
Hi. I'm still having problems with the uvector package. I have an IntMap (UArr xxx) data type, and I want to serialize it to disk, in binary format. I'm using the uvector package from http://patch-tag.com/repo/pumpkin-uvector/home The problem is with missing instance declarations, for

Re: [Haskell-cafe] Re: [Haskell] Lazy IO breaks purity

2009-03-05 Thread Lennart Augustsson
You're assuming that IO operations have semantics. From the Haskell program's point of view, and when reasoning about Haskell programs (not their interaction with the world) you should assume that every IO operation returns a random result. The way Oleg's program behaves does not break RT under

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Hans Aberg
On 5 Mar 2009, at 15:23, Daniel Fischer wrote: Just to flesh this up a bit: let f : P(N) - R be given by f(M) = sum [2*3^(-k) | k - M ] f is easily seen to be injective. define g : (0,1) - P(N) by let x = sum [a_k*2^(-k) | k in N (\{0}), a_k in {0,1}, infinitely many a_k = 1] and then g(x)

Re: [Haskell-cafe] Re: [Haskell] Lazy IO breaks purity

2009-03-05 Thread Jonathan Cast
On Thu, 2009-03-05 at 13:08 +, Simon Marlow wrote: Lennart Augustsson wrote: I don't see any breaking of referential transparence in your code. Every time you do an IO operation the result is basically non-deterministic since you are talking to the outside world. You're assuming the

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Daniel Fischer
Am Donnerstag, 5. März 2009 16:55 schrieb Hans Aberg: On 5 Mar 2009, at 15:23, Daniel Fischer wrote: Just to flesh this up a bit: let f : P(N) - R be given by f(M) = sum [2*3^(-k) | k - M ] f is easily seen to be injective. define g : (0,1) - P(N) by let x = sum [a_k*2^(-k) | k in N

Re: [Haskell-cafe] Re: [Haskell] Lazy IO breaks purity

2009-03-05 Thread Svein Ove Aas
On Thu, Mar 5, 2009 at 2:08 PM, Simon Marlow marlo...@gmail.com wrote: So the argument is something like: we can think of the result of a call to unsafeInterleaveIO as having been chosen at the time we called unsafeInterleaveIO, rather than when its result is actually evaluated. This is on

Re: [Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Hans Aberg
On 5 Mar 2009, at 17:06, Daniel Fischer wrote: Cantor-Bernstein doesn't require choice (may be different for intuitionists). http://en.wikipedia.org/wiki/Cantor-Bernstein_theorem Yes, that is right, Mendelson says that. - I find it hard to figure out when it is used, as it is so

Re: [Haskell-cafe] missing support to Data.Binary for uvector package

2009-03-05 Thread Daniel Peebles
Hi Manlio, I'm not sure the whole list wants to hear about bugs in my modifications to an alpha library! :-) But basically, I haven't added a Binary instance for productions like that yet. This isn't trivial, but shouldn't be hard. Otherwise, using the unsafe serialization functions I provide in

Re: [Haskell-cafe] Re: [Haskell] Lazy IO breaks purity

2009-03-05 Thread Gregg Reynolds
On Thu, Mar 5, 2009 at 7:08 AM, Simon Marlow marlo...@gmail.com wrote: So the argument is something like: we can think of the result of a call to unsafeInterleaveIO as having been chosen at the time we called unsafeInterleaveIO, rather than when its result is actually evaluated. This is on

Re: [Haskell-cafe] How to make a dock window for xmonad using gtk2hs?

2009-03-05 Thread Brandon S. Allbery KF8NH
On 2009 Mar 5, at 8:21, Andrea Rossato wrote: On Wed, Mar 04, 2009 at 10:59:53PM -0500, Brandon S. Allbery KF8NH wrote: On 2009 Mar 4, at 21:40, Magicloud Magiclouds wrote: Could someone give me a sample or something I could learn from? Thanks. (xmobar is open source, you could look

[Haskell-cafe] Re: MPI

2009-03-05 Thread FFT
On Wed, Mar 4, 2009 at 5:03 PM, FFT fft1...@gmail.com wrote: Are MPI bindings still the best way of using Haskell on Beowulf clusters? It's my feeling that the bindings stagnated, or are they just very mature? What's the story with distributed memory multiprocessing? Are Haskell programmers

Re: [Haskell-cafe] monadic MapReduce

2009-03-05 Thread Anish Muttreja
On Tue, Mar 03, 2009 at 07:27:35AM -1000, Tim Newsham wrote: How about this. Is there a reason why I can't replace the variables b and c in the type signature of mapReduce with with (IO b') and (IO c'). b and c can be any types. mapReduce :: Strategy (IO b')-- evaluation strategy for

[Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Joseph Fredette
I've been working on a little project, and one of the things I need to do is dynamically compile and import a Haskell Source file containing filtering definitions. I've written a small monad called Filter which is simply: type Filter a = Reader (Config, Email) a To encompass all the email

[Haskell-cafe] Test if a file is empty or stat in haskell

2009-03-05 Thread Anish Muttreja
I am looking for a way to test if a file is empty. Something like isFileEmpty along the lines of System.Directory.doesFileExist? A function that wraps stat would also serve the purpose. I get the feeling that someone must have felt the need for this before me, but Google search not yield

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Daniel Fischer
Am Donnerstag, 5. März 2009 19:48 schrieb Joseph Fredette: getFilterMain :: Deliverable a = FilePath - Interpreter (Filter a) getFilterMain fMainLoc = do loadModules [fMainLoc]; setTopLevelModules [(takeWhile (/='.') fMainLoc)] fMain - (interpret

Re: [Haskell-cafe] Test if a file is empty or stat in haskell

2009-03-05 Thread Daniel Fischer
Am Donnerstag, 5. März 2009 19:56 schrieb Anish Muttreja: I am looking for a way to test if a file is empty. Something like isFileEmpty along the lines of System.Directory.doesFileExist? If you're on a *nixy OS, System.Posix.Files getFileStatus, fileSize ... dunno if Windows has similar

Re: [Haskell-cafe] Test if a file is empty or stat in haskell

2009-03-05 Thread Henk-Jan van Tuyl
On Thu, 05 Mar 2009 19:56:42 +0100, Anish Muttreja anishmuttr...@gmail.com wrote: I am looking for a way to test if a file is empty. Something like isFileEmpty along the lines of System.Directory.doesFileExist? A function that wraps stat would also serve the purpose. I get the feeling that

Re: [Haskell-cafe] Test if a file is empty or stat in haskell

2009-03-05 Thread Anish Muttreja
On Thu, Mar 05, 2009 at 08:15:03PM +0100, Daniel Fischer wrote: Am Donnerstag, 5. März 2009 19:56 schrieb Anish Muttreja: I am looking for a way to test if a file is empty. Something like isFileEmpty along the lines of System.Directory.doesFileExist? If you're on a *nixy OS,

Re: [Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-05 Thread Don Stewart
Avoid unpack! ndmitchell: Hi Gwern, I get String/Data.Binary issues too. My suggestion would be to change your strings to ByteString's, serisalise, and then do the reverse conversion when reading. Interestingly, a String and a ByteString have identical Data.Binary reps, but in my

Re: [Haskell-cafe] missing support to Data.Binary for uvector package

2009-03-05 Thread Don Stewart
manlio_perillo: Hi. I'm still having problems with the uvector package. I have an IntMap (UArr xxx) data type, and I want to serialize it to disk, in binary format. I'm using the uvector package from http://patch-tag.com/repo/pumpkin-uvector/home The problem is with missing

Re: [Haskell-cafe] How to make a dock window for xmonad using gtk2hs?

2009-03-05 Thread Andrea Rossato
On Thu, Mar 05, 2009 at 12:50:20PM -0500, Brandon S. Allbery KF8NH wrote: On 2009 Mar 5, at 8:21, Andrea Rossato wrote: xmobar is not open source. xmobar is FREE software! I don't do fundamentalist religion... qualifying as fundamentalism the avoidance of cheap marketing strategies is just a

Re: [Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-05 Thread Neil Mitchell
Avoid massive reductions in runtime while maintaining the same API? I did move to using ByteString's internally for those bits later on, but reading String's from Data.Binary with a ByteString+unpack went much more quickly than reading String's On Thu, Mar 5, 2009 at 7:35 PM, Don Stewart

Re: [Haskell-cafe] Test if a file is empty or stat in haskell

2009-03-05 Thread Neil Mitchell
Hi I am on Linux. BTW, Hoogle does not seem to  know about System.Posix.Files, though it did point me to System.IO.FileSize which would also have served the purpose. To build the Hoogle libraries I need to build the packages. I run Windows not Linux, so its a bit difficult to index

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Joseph Fredette
This doesn't seem to do it, same type error... Maybe I need to use some kind of witness type -- to inform the compiler of the type of a @ runtime? Daniel Fischer wrote: Am Donnerstag, 5. März 2009 19:48 schrieb Joseph Fredette: getFilterMain :: Deliverable a = FilePath - Interpreter

Re: [Haskell-cafe] Test if a file is empty or stat in haskell

2009-03-05 Thread Thomas DuBuisson
getFileStatus, fileSize ... Great, thanks. BTW, Hoogle does not seem to  know about System.Posix.Files, though it did point me to System.IO.FileSize which would also have served the purpose. Yep, this was discussed in a Hoogle and Network.Socket thread I started last week. There is a wiki

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Ryan Ingram
So, by using the Haskell interpreter, you're using the not-very-well-supported dynamically-typed subset of Haskell. You can tell this from the type signature of interpret: interpret :: Typeable a = String - a - Interpreter a as :: Typeable a = a as = undefined (from

[Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Achim Schneider
Luke Palmer lrpal...@gmail.com wrote: I don't think set theory is trivial in the least. I think it is complicated, convoluted, often anti-intuitive and nonconstructive. Waaagh! I mean trivial in the mathematical sense, as in how far away from the axioms you are. The other kind of

[Haskell-cafe] Re: Theory about uncurried functions

2009-03-05 Thread Achim Schneider
To wrap up: While formalising, there is always a tradeoff between complexity of the theory you're using and the complexity of it being applied to some specific topic. Category theory hits a very, very sweet spot there. -- (c) this sig last receiving data processing entity. Inspect headers for

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Joseph Fredette
So, I tried both of those things, both each alone and together. No dice. Same error, so I reverted back to the original. :( However, I was, after some random type signature insertions, able to convert the problem into a different one, via: getFilterMain :: Deliverable a = FilePath -

[Haskell-cafe] Haskell Logo Voting will start soon!

2009-03-05 Thread Eelco Lempsink
Hi there! It's been quiet for a while around the 'new logo' competition, but here is how it is going to work: The list with options can be found here (for now): http://community.haskell.org/~eelco/poll.html Notice that some (very) similar logos are grouped as one option (thanks to Ian

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-05 Thread Henning Thielemann
On Wed, 4 Mar 2009, John Lato wrote: John A. De Goes schrieb: Elsewhere, laziness can be a real boon, so I don't understand your question, Why have laziness in Haskell at all? As I have written, many libaries process their data lazily (or could be changed to do so without altering their

[Haskell-cafe] Re: Haskell Logo Voting will start soon!

2009-03-05 Thread Achim Schneider
Eelco Lempsink ee...@lempsink.nl wrote: The poll won't be public, but every subscriber to Haskell-Cafe will get a (private) voting ballot by email. What about us gmane users? -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved.

Re: [Haskell-cafe] Haskell Logo Voting will start soon!

2009-03-05 Thread Don Stewart
eelco: Hi there! It's been quiet for a while around the 'new logo' competition, but here is how it is going to work: The list with options can be found here (for now): http://community.haskell.org/~eelco/poll.html Notice that some (very) similar logos are grouped as one option (thanks

[Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Daryoush Mehrtash
In this chat server implementation http://www.haskell.org/haskellwiki/Implement_a_chat_server forkIO is used with fix as in: reader - forkIO $ http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:. fix $ http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:.

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Jonathan Cast
On Thu, 2009-03-05 at 15:36 -0800, Daryoush Mehrtash wrote: In this chat server implementation http://www.haskell.org/haskellwiki/Implement_a_chat_server forkIO is used with fix as in: reader - forkIO $ fix $ \loop - do (nr', line) - readChan chan' when (nr /= nr') $

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Derek Elkins
On Thu, 2009-03-05 at 16:12 -0800, Jonathan Cast wrote: On Thu, 2009-03-05 at 15:36 -0800, Daryoush Mehrtash wrote: In this chat server implementation http://www.haskell.org/haskellwiki/Implement_a_chat_server forkIO is used with fix as in: reader - forkIO $ fix $ \loop - do

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Daniel Gorín
Hi I've downloaded Hackmain from patch-tag, but I'm getting a different error. The error I get is: Hackmain.hs:63:10: No instance for (Data.Typeable.Typeable2 Control.Monad.Reader.Reader) arising from a use of `interpret' at Hackmain.hs:63:10-67 Hint

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-05 Thread Duncan Coutts
On Thu, 2009-03-05 at 23:52 +0100, Henning Thielemann wrote: On Wed, 4 Mar 2009, John Lato wrote: John A. De Goes schrieb: Elsewhere, laziness can be a real boon, so I don't understand your question, Why have laziness in Haskell at all? As I have written, many libaries process their

Re: [Haskell-cafe] Difficulties in accessing inner elements of data types

2009-03-05 Thread Sean Leather
Hi David, I'm working on a Haskell library for interacting with emacs org files. For those that do not know, an org file is a structured outline style file that has nested headings, text, tables and other elements. Great! Sounds like fun. :) Now, this all works as expected (files are

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Joseph Fredette
Oh, crap- I must have never pushed the latest patches, I did put the typeable instances in all the appropriate places. And provided a (maybe incorrect? Though I'm fairly sure that shouldn't affect the bug I'm having now) Typeable implementation for Reader, but I still get this ambiguous type.

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Donn Cave
Quoth Jonathan Cast jonathancc...@fastmail.fm: You can certainly use let: reader - forkIO $ let loop = do (nr', line) - readChan chan' when (nr /= nr') $ hPutStrLn hdl line loop in loop But the version with fix is clearer (at least to people who have fix in their

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Luke Palmer
On Thu, Mar 5, 2009 at 6:27 PM, Donn Cave d...@avvanta.com wrote: Quoth Jonathan Cast jonathancc...@fastmail.fm: You can certainly use let: reader - forkIO $ let loop = do (nr', line) - readChan chan' when (nr /= nr') $ hPutStrLn hdl line loop in loop

[Haskell-cafe] Calculating with list comprehension

2009-03-05 Thread R J
I can calculate non-nested list comprehensions without a problem, but am unable to calculate nested comprehensions involving, for example, the generation of a list of pairs where the first and separate elements are drawn from two separate lists, as in: [(a, b) | a - [1..3], b - [1..2]]

Re: [Haskell-cafe] Calculating with list comprehension

2009-03-05 Thread Dan Weston
Keep in mind this is a *lexical* rewrite. In the generator rule x and e are not independent: x is a pattern (which introduces a bind variable) and e is an expression (with free variables, one of which may be bound by x) After one application of the generator rule, we get (using a lambda

Re: [Haskell-cafe] Hint and Ambiguous Type issue

2009-03-05 Thread Daniel Gorín
Ok, so I've pulled the latest version and the error I get now is: Hackmain.hs:70:43: Ambiguous type variable `a' in the constraint: `Deliverable a' arising from a use of `getFilterMainStuff' at Hackmain.hs: 70:43-60 Probable fix: add a type signature that fixes these type

Re: [Haskell-cafe] Re: [Haskell] Lazy IO breaks purity

2009-03-05 Thread Brandon S. Allbery KF8NH
On 2009 Mar 5, at 8:08, Simon Marlow wrote: So the argument is something like: we can think of the result of a call to unsafeInterleaveIO as having been chosen at the time we called unsafeInterleaveIO, rather than when its result is actually evaluated. This is on dodgy ground, IMO: either

Re: [Haskell-cafe] Difficulties in accessing inner elements of data types

2009-03-05 Thread David Miani
Well thanks to everyone that has replied so far - I've had an interesting time trying out different ideas. Firstly, for Neil Mitchell's suggestions regarding uniplate: I read through both uniplate and scrap your boilerplate libraries (found the second after reading about uniplate). For whatever