Re: [Haskell-cafe] How to make callCC more dynamic

2011-08-27 Thread oleg
ContT {runContT :: forall r1 . (forall r2 . a- m r2) - m r1} callCC can be defined, however, you can not run it, and reset couldn't type check Indeed you cannot. As the articles http://okmij.org/ftp/continuations/undelimited.html explain, the answer of _undelimited_ continuation is

Re: [Haskell-cafe] Project Euler: request for comments

2011-08-27 Thread Daniel Fischer
On Saturday 27 August 2011, 02:34:24, Oscar Picasso wrote: Hi, I order to improve my Haskell skills I started (again) to solve the project euler problems with this language. I am now at problem 11 and would really appreciate any comment about my code in order to make it more elegant or

Re: [Haskell-cafe] bitSize

2011-08-27 Thread Andrew Coppin
On 26/08/2011 10:51 PM, Steve Schafer wrote: On Fri, 26 Aug 2011 20:30:02 +0100, you wrote: You wouldn't want to know how many bits you need to store on disk to reliably recreate the value? I can't say that I have cared about that sort of thing in a very long time. Bits are rather cheap

Re: [Haskell-cafe] Project Euler: request for comments

2011-08-27 Thread Oscar Picasso
Daniel, There are included as gists on the link provided. After your remark, I looked at the generated html code in my blog. The gists are actually displayed by running a javascript. Maybe your browser settings don't allow to display them. If so, you can also look directly at the gists: pb 01:

Re: [Haskell-cafe] Project Euler: request for comments

2011-08-27 Thread Daniel Fischer
On Saturday 27 August 2011, 16:03:46, Oscar Picasso wrote: Daniel, There are included as gists on the link provided. After your remark, I looked at the generated html code in my blog. The gists are actually displayed by running a javascript. Maybe your browser settings don't allow to

Re: [Haskell-cafe] Project Euler: request for comments

2011-08-27 Thread Oscar Picasso
Daniel, Thank you very much for your comments, there are very useful, indeed. As a side note, my domain name is not oscarpicasso.com. It was already taken by someone else so I decided to use opicasso.com Oscar On Sat, Aug 27, 2011 at 11:05 AM, Daniel Fischer daniel.is.fisc...@googlemail.com

Re: [Haskell-cafe] Project Euler: request for comments

2011-08-27 Thread Daniel Fischer
On Saturday 27 August 2011, 17:31:41, Oscar Picasso wrote: As a side note, my domain name is not oscarpicasso.com. It was already taken by someone else so I decided to use opicasso.com Oh, yeah, it was that I allowed, misremembered the domain name.

Re: [Haskell-cafe] bitSize

2011-08-27 Thread Steve Schafer
On Sat, 27 Aug 2011 11:57:57 +0100, you wrote: I meant if you're trying to *implement* serialisation. The Bits class allows you to access bits one by one, but surely you'd want some way to know how many bits you need to keep? For fixed-size types (e.g., Int), I might use a simple byte-for-byte

[Haskell-cafe] HJavaScript: representing build-in global function.

2011-08-27 Thread Станислав Черничкин
Hi Cafe! Does someone know how to represent js build-in global function (such as parseInt(), parseFloat(), eval()) with HJavaScript? Perhaps JConst: JCall (JConst parseInt) (JString 123)? -- Sincerely, Stanislav Chernichkin. ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Ambiguous module name `System.Directory'

2011-08-27 Thread Michael Snoyman
One other solution on this one: upgrade system-fileio. The newest version does not contain any conflicting names. As a side point, system-fileio (and system-filepath, which it depends upon) are both excellent packages, I use them all the time at work. Michael On Sat, Aug 27, 2011 at 12:44 AM,

[Haskell-cafe] Modules and a main function

2011-08-27 Thread michael rice
W/r/t the code below, would somebody please explain the sense of having a main function in a module that is not named Main.hs? Michael From: http://www.haskell.org/haskellwiki/State_Monad module StateGame where   import Control.Monad.State   -- Example use of State monad --

Re: [Haskell-cafe] Modules and a main function

2011-08-27 Thread Brandon Allbery
On Sat, Aug 27, 2011 at 15:31, michael rice nowg...@yahoo.com wrote: W/r/t the code below, would somebody please explain the sense of having a main function in a module that is not named Main.hs? It's embedded test code; you can build a test program for the StateGame monad by using the

Re: [Haskell-cafe] bitSize

2011-08-27 Thread Brandon Allbery
On Sat, Aug 27, 2011 at 06:57, Andrew Coppin andrewcop...@btinternet.comwrote: On 26/08/2011 10:51 PM, Steve Schafer wrote: On Fri, 26 Aug 2011 20:30:02 +0100, you wrote: You wouldn't want to know how many bits you need to store on disk to reliably recreate the value? I can't say that I

Re: [Haskell-cafe] Modules and a main function

2011-08-27 Thread michael rice
I'm not sure how to do that. Please demonstrate. Michael From: Brandon Allbery allber...@gmail.com To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org haskell-cafe@haskell.org Sent: Saturday, August 27, 2011 3:53 PM Subject: Re: [Haskell-cafe]

Re: [Haskell-cafe] Modules and a main function

2011-08-27 Thread Brandon Allbery
On Sat, Aug 27, 2011 at 16:24, michael rice nowg...@yahoo.com wrote: I'm not sure how to do that. Please demonstrate. If you just compile it normally you have an unexported binding called main which is effectively (and actually, when compiled with optimization) discarded. If you do ghc

Re: [Haskell-cafe] Modules and a main function

2011-08-27 Thread Daniel Fischer
On Saturday 27 August 2011, 22:24:03, michael rice wrote: I'm not sure how to do that. Please demonstrate. Michael ghc -O -main-is StateGame --make StateGame more generally, ghc -O -main-is Foo.bar --make Foo if the desired main is function bar in module Foo.

Re: [Haskell-cafe] Modules and a main function

2011-08-27 Thread michael rice
Thanks all. I was trying to use --main-is. I even man-ed ghc and thought I saw a double dash there. As they say, believing is seeing. Michael From: Daniel Fischer daniel.is.fisc...@googlemail.com To: haskell-cafe@haskell.org; michael rice nowg...@yahoo.com

[Haskell-cafe] GHCI Feature Request: Last Successful Compilation State Saved

2011-08-27 Thread aditya siram
Hi all, I would like for the GHCI interpreter to save its environment before reloading a file and allowed the user to revert back to that state if the compilation was unsuccessful. Many times I've changed files, loaded them, hit a compilation error and needed, for example, the inferred type

Re: [Haskell-cafe] GHCI Feature Request: Last Successful Compilation State Saved

2011-08-27 Thread David Virebayre
2011/8/27 aditya siram aditya.si...@gmail.com: Hi all, I would like for the GHCI interpreter to save its environment before reloading a file and allowed the user to revert back to that state if the compilation was unsuccessful. That would be awesome. I would like this too. David.

Re: [Haskell-cafe] GHCI Feature Request: Last Successful Compilation State Saved

2011-08-27 Thread Daniel Fischer
On Saturday 27 August 2011, 23:10:17, David Virebayre wrote: 2011/8/27 aditya siram aditya.si...@gmail.com: Hi all, I would like for the GHCI interpreter to save its environment before reloading a file and allowed the user to revert back to that state if the compilation was unsuccessful.

Re: [Haskell-cafe] GHCI Feature Request: Last Successful Compilation State Saved

2011-08-27 Thread Daniel Patterson
That doesn't look very promising :( On Aug 27, 2011, at 5:31 PM, Daniel Fischer wrote: On Saturday 27 August 2011, 23:10:17, David Virebayre wrote: 2011/8/27 aditya siram aditya.si...@gmail.com: Hi all, I would like for the GHCI interpreter to save its environment before reloading a file

Re: [Haskell-cafe] GHCI Feature Request: Last Successful Compilation State Saved

2011-08-27 Thread aditya siram
http://www.youtube.com/watch?v=Y_exermAXkUt=0m6s -deech On Sat, Aug 27, 2011 at 4:56 PM, Daniel Patterson lists.hask...@dbp.mm.stwrote: That doesn't look very promising :( On Aug 27, 2011, at 5:31 PM, Daniel Fischer wrote: On Saturday 27 August 2011, 23:10:17, David Virebayre wrote:

Re: [Haskell-cafe] Project Euler: request for comments

2011-08-27 Thread KC
Think of the simplest version of the problem that isn't totally trivial. e.g. A one dimensional list of numbers. What would you do? Note: you only want to touch each element once. The 2 dimensional case could be handled by putting into lists: rows, columns, major diagonals, and minor

[Haskell-cafe] GHC API question

2011-08-27 Thread Chris Smith
I'm using the GHC API in GHC 7.2, and running into some problems. For background, I have working code that uses compileExpr to get a value from a dynamically loaded module. However, I'd like to do some profiling, and it appears that compileExpr doesn't work from executables that are built with