Re: [Haskell-cafe] Static linking problem // CentOS 5.5 - GHC 6.12.3

2011-03-16 Thread Ketil Malde
frode k mailingl...@klevstul.com writes: However I do of course want to run it through CGI on a webserver. I'm running lighttpd. If I try to run the file compiled above I get 500 - Internal Server Error, most likely since the enviroment is not correct for dynamic linked files: Why wouldn't

Re: [Haskell-cafe] Install GTK on Windows

2011-03-16 Thread José Pedro Magalhães
Thanks, that worked! First it was loading stuff from graphviz, and then from sysWOW64... now I finally run threadscope :-) Cheers, Pedro 2011/3/15 Ryan Yates fryguy...@gmail.com Hi Pedro, Perhaps the libglib-2.0.0.dll that is getting loaded is not the one you want. You should be able to

Re: [Haskell-cafe] Static linking problem // CentOS 5.5 - GHC 6.12.3

2011-03-16 Thread frode k
On Wed, Mar 16, 2011 at 8:05 AM, Ketil Malde ke...@malde.org wrote: frode k mailingl...@klevstul.com writes: However I do of course want to run it through CGI on a webserver. I'm running lighttpd. If I try to run the file compiled above I get 500 - Internal Server Error, most likely since

[Haskell-cafe] Writing functions over GADTs

2011-03-16 Thread Dominic Mulligan
Dear all, I'm working on a small proof assistant in Haskell. In the logic that I'm implementing it's very important that I distinguish between `large' and `small' types for consistency reasons. I have worked to get this distinction reflected in my types with the use of GADTs, like so: data

Re: [Haskell-cafe] Static linking problem // CentOS 5.5 - GHC 6.12.3

2011-03-16 Thread J . Waldmann
Why wouldn't the environment (i.e. available dynamic libraries) be correct for the web server? beacuse it runs CGI programs in a chroot jail? Then you need to copy the .so files into the jail, cf. http://www.cyberciti.biz/tips/howto-setup-lighttpd-php-mysql-chrooted-jail.html J.W.

Re: [Haskell-cafe] Static linking problem // CentOS 5.5 - GHC 6.12.3

2011-03-16 Thread frode k
I had missed out some settings in the configuration files of lighttpd. Summary: - I renamed the Haskell test file to haskell.hcgi - I edited /etc/lighttpd/conf.d/cgi.conf and added two entries in the cgi.assign section, one for .hcgi and one for .hs (the latter one only to enable running of .hs

[Haskell-cafe] Type trickery

2011-03-16 Thread Andrew Coppin
The well-known ST monad uses an ingenious hack to make it impossible for distinct ST computations to interact with each other. Is there a way to do something similar so that I can create cursors that reference a (mutable) container, and then write a function that takes two cursor arguments

Re: [Haskell-cafe] Type trickery

2011-03-16 Thread Bas van Dijk
On 16 March 2011 11:31, Andrew Coppin andrewcop...@btinternet.com wrote: The well-known ST monad uses an ingenious hack to make it impossible for distinct ST computations to interact with each other. Is there a way to do something similar so that I can create cursors that reference a

Re: [Haskell-cafe] Type trickery

2011-03-16 Thread Andrew Coppin
You could define a function: withContainer ∷ (∀ s. Container s → α) → α which creates a container, parameterizes it with an 's' that is only scoped over the continuation and applies the continuation to the created container. Hmm, yes. That will work, but I wonder if there's some way of doing

Re: [Haskell-cafe] ANN: Monad.Reader special Poetry and Fiction Edition

2011-03-16 Thread Andrew Coppin
On 15/03/2011 11:35 PM, Brent Yorgey wrote: I am pleased to announce that the special Poetry and Fiction Edition of The Monad.Reader is now available [1]. Enjoy! I love exercise 8, write a complete computer game using this idea (!) ___ Haskell-Cafe

[Haskell-cafe] Subsets and supersets

2011-03-16 Thread Andrew Coppin
The other day I saw the green field Haskell discussion on Reddit. Of course, I could give you a very long list (ha!) of things that I would change about Haskell. (This would probably begin with expunging Monad.fail with extreme prejudice...) But there's one particular feature which is

Re: [Haskell-cafe] Type trickery

2011-03-16 Thread Miguel Mitrofanov
I fail to see how does it limit the scope. 16.03.2011 15:05, Andrew Coppin пишет: You could define a function: withContainer ∷ (∀ s. Container s → α) → α which creates a container, parameterizes it with an 's' that is only scoped over the continuation and applies the continuation to the

Re: [Haskell-cafe] Type trickery

2011-03-16 Thread Tillmann Rendel
Hi Andrew, Andrew Coppin wrote: You could define a function: withContainer ∷ (∀ s. Container s → α) → α which creates a container, parameterizes it with an 's' that is only scoped over the continuation and applies the continuation to the created container. Hmm, yes. That will work, but I

Re: [Haskell-cafe] Subsets and supersets

2011-03-16 Thread Brandon Moore
You want polymorphic variants. Check out O'Caml, or MLPolyR. Subtyping is not very compatible with first-class functions. If you have subtype-bounded polymorphism (forall A a subtype of T, ...), and your subtype relation says A - B is a subtype of C -D whenever A is a supertype of C and B is a

Re: [Haskell-cafe] Type trickery

2011-03-16 Thread Andrew Coppin
Hmm, yes. That will work, but I wonder if there's some way of doing this that doesn't limit the scope of the container to one single span of code... You can write helper functions which take containers as argument by parameterizing these helper functions over s: takesTwoContainers :: Container

Re: [Haskell-cafe] Subsets and supersets

2011-03-16 Thread Yves Parès
your subtype relation says A - B is a subtype of C -D whenever A is a supertype of C and B is a subtype of D, then checking subtyping is undecidable. In fashion terms: operator (-) is contravariant in its first argument and covariant in its second. ;) 2011/3/16 Brandon Moore

Re: [Haskell-cafe] ANN: Monad.Reader special Poetry and Fiction Edition

2011-03-16 Thread Yves Parès
Concerning this exercise, would it be simply possible to take the most of lazy evaluation and build a graph? A node would be: Node a = Node { data:: a, parents :: [Node a], children :: [Node a] } Then, whichever node you are on, you can still directly find its

Re: [Haskell-cafe] Type trickery

2011-03-16 Thread Lauri Alanko
On Wed, Mar 16, 2011 at 12:05:56PM +, Andrew Coppin wrote: withContainer ∷ (∀ s. Container s → α) → α Hmm, yes. That will work, but I wonder if there's some way of doing this that doesn't limit the scope of the container to one single span of code... You can just pack the container into

Re: [Haskell-cafe] Writing functions over GADTs

2011-03-16 Thread Benedikt Huber
On 16.03.11 10:26, Dominic Mulligan wrote: Dear all, I'm working on a small proof assistant in Haskell. In the logic that I'm implementing it's very important that I distinguish between `large' and `small' types for consistency reasons. I have worked to get this distinction reflected in my

Re: [Haskell-cafe] ANN: Monad.Reader special Poetry and Fiction Edition

2011-03-16 Thread Brent Yorgey
On Wed, Mar 16, 2011 at 03:03:20PM +0100, Yves Parès wrote: Concerning this exercise, would it be simply possible to take the most of lazy evaluation and build a graph? A node would be: Node a = Node { data:: a, parents :: [Node a], children :: [Node a]

Re: [Haskell-cafe] ANN: Monad.Reader special Poetry and Fiction Edition

2011-03-16 Thread Andrew Coppin
On 16/03/2011 03:05 PM, Brent Yorgey wrote: This kind of knot-tying approach is nice for static graphs. I think we should have a wiki page somewhere which explains what all the various Haskell-related terms mean. Terms like typing the knot and finally tagless. (Not to mention Oleg

Re: [Haskell-cafe] ANN: Monad.Reader special Poetry and Fiction Edition

2011-03-16 Thread aditya siram
Knot-tying has a page [1]. -deech [1] http://www.haskell.org/haskellwiki/Tying_the_Knot On Wed, Mar 16, 2011 at 10:42 AM, Andrew Coppin andrewcop...@btinternet.com wrote: On 16/03/2011 03:05 PM, Brent Yorgey wrote: This kind of knot-tying approach is nice for static graphs. I think we

Re: [Haskell-cafe] haskell mailing lists followup?

2011-03-16 Thread teerlist
On Tue, Mar 15, 2011 at 04:44:26PM -0700, wren ng thornton wrote: [...] come through. So maybe re-enabling delivery fixed it this time? I hadn't dug to find Kenneth Hoste's original message Wed Mar 9 15:40:45 CET on the Haskell list. That had enough info to localise the problem: haskell.org

Re: [Haskell-cafe] X11 package bug: XClientMessageEvent long data

2011-03-16 Thread Spencer Janssen
On Wed, Mar 16, 2011 at 12:10:59AM -0400, Dylan Alex Simon wrote: Does anyone know the current maintenance status of the X11 package? I emailed Spencer Janssen a number of months ago and never heard back. So, I'll put this here in case any one else runs into it or can get it to the right

[Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Yves Parès
Hello, A question recently popped into my mind: does lazy evaluation reduce the need to proper tail-recursion? I mean, for instance : fmap f [] = [] fmap f (x:xs) = f x : fmap f xs Here fmap is not tail-recursive, but thanks to the fact that operator (:) is lazy, I think that it may still run

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Tillmann Rendel
Hi, Yves Parès wrote: A question recently popped into my mind: does lazy evaluation reduce the need to proper tail-recursion? I mean, for instance : fmap f [] = [] fmap f (x:xs) = f x : fmap f xs Here fmap is not tail-recursive, but thanks to the fact that operator (:) is lazy, I think that

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Daniel Fischer
On Wednesday 16 March 2011 18:31:00, Yves Parès wrote: Hello, A question recently popped into my mind: does lazy evaluation reduce the need to proper tail-recursion? I mean, for instance : fmap f [] = [] fmap f (x:xs) = f x : fmap f xs Here fmap is not tail-recursive, but thanks to

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Yves Parès
Yes, and a tail-recursive map couldn't run in constant space Yes, I meant if you are consuming it just once immediately. the above pattern [...] is better, have the recursive call as a non-strict field of a constructor. Which pattern? Mine or Tillman's? Or both? 2011/3/16 Daniel Fischer

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Henning Thielemann
On Wed, 16 Mar 2011, Daniel Fischer wrote: Tail recursion is good for strict stuff, otherwise the above pattern - I think it's called guarded recursion - is better, have the recursive call as a non-strict field of a constructor. In http://haskell.org/haskellwiki/Tail_recursion it is also

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Daniel Fischer
On Wednesday 16 March 2011 20:02:54, Yves Parès wrote: Yes, and a tail-recursive map couldn't run in constant space Yes, I meant if you are consuming it just once immediately. And that's what, to my knowledge, is impossible with tail recursion. A tail recursive map/fmap would have to

Re: [Haskell-cafe] Type trickery

2011-03-16 Thread Luke Palmer
On Wed, Mar 16, 2011 at 7:52 AM, Andrew Coppin andrewcop...@btinternet.com wrote: Hmm, yes. That will work, but I wonder if there's some way of doing this that doesn't limit the scope of the container to one single span of code... You can write helper functions which take containers as

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Tillmann Rendel
Hi, Daniel Fischer wrote: data EvaluatedList a = Cons a (List a) | Empty type List a = () - EvaluatedList a map :: (a - b) - (List a - List b) map f xs = \_ - case xs () of Cons x xs - Cons (f x) (\_ - map f xs ())

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Yves Parès
And that's what, to my knowledge, is impossible with tail recursion. A tail recursive map/fmap would have to traverse the entire list before it could return anything. Now that you say it, yes, you are right. Tail recursion imposes strictness, since only the very last call can return something.

[Haskell-cafe] Installation of Haskell Platform on CentOS 5.5

2011-03-16 Thread frode k
Hi. I've spent some time trying to setup the Haskell Platform on CentOS 5.5: # cat /proc/version Linux version 2.6.18-028stab070.14 (root@rhel5-build-x64) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Thu Nov 18 16:04:02 MSK 2010 I've compiled from source, similar to what is done here:

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Daniel Fischer
On Wednesday 16 March 2011 21:44:36, Tillmann Rendel wrote: My point is that the call to map is in tail position, because it is the last thing the function (\_ - map f xs ()) does. So it is not a tail-recursive call, but it is a tail call. Mmmm, okay, minor terminology mismatch, then.

[Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-16 Thread JP Moresmau
Hello, when moving to GHC7 a body of code that I'm not immensely familiar with, I got an error compiling with GHC 7.0.2. Can somebody kindly explain to me what it means and how to get around it? This is in the scion code base so is using some GHC types. I have a class with a functional dependency

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Daniel Fischer
On Wednesday 16 March 2011 22:03:51, Yves Parès wrote: Can a type signature give you a hint about whether a function evaluates some/all of its arguments (i.e. is strict/partially strict/lazy), or do you have to look at the implementation to know? Cheating, with GHC, a magic hash tells you it's

Re: [Haskell-cafe] ANN: Monad.Reader special Poetry and Fiction Edition

2011-03-16 Thread Henk-Jan van Tuyl
On Wed, 16 Mar 2011 16:42:09 +0100, Andrew Coppin andrewcop...@btinternet.com wrote: On 16/03/2011 03:05 PM, Brent Yorgey wrote: This kind of knot-tying approach is nice for static graphs. I think we should have a wiki page somewhere which explains what all the various Haskell-related

[Haskell-cafe] Haskell Weekly News: Issue 173

2011-03-16 Thread Daniel Santa Cruz
Welcome to issue 173 of the HWN, a newsletter covering developments in the [1]Haskell community. This release covers the week of March 06-12, 2011. For a (easier to read) HTML version goto: http://bit.ly/gQCQHf Announcements Bas van Dijk [2]annouced updates to regions (0.9),

Re: [Haskell-cafe] Type trickery

2011-03-16 Thread wren ng thornton
On 3/16/11 9:52 AM, Andrew Coppin wrote: Hmm, yes. That will work, but I wonder if there's some way of doing this that doesn't limit the scope of the container to one single span of code... You can write helper functions which take containers as argument by parameterizing these helper

[Haskell-cafe] Data.Time.Calendar.Day does not seem to have an instance for Read

2011-03-16 Thread C K Kashyap
Hi, I was wondering if this is a defect - Prelude import Data.Time.Calendar Prelude Data.Time.Calendar read 2011-10-10 :: Day interactive:1:1: No instance for (Read Day) arising from a use of `read' Possible fix: add an instance declaration for (Read Day) In the expression:

Re: [Haskell-cafe] Data.Time.Calendar.Day does not seem to have an instance for Read

2011-03-16 Thread Antoine Latter
On Thu, Mar 17, 2011 at 12:30 AM, C K Kashyap ckkash...@gmail.com wrote: Hi, I was wondering if this is a defect - Prelude import Data.Time.Calendar Prelude Data.Time.Calendar read 2011-10-10 :: Day interactive:1:1:     No instance for (Read Day)       arising from a use of `read'     

Re: [Haskell-cafe] Data.ByteString.Lazy.ByteString vs Data.ByteString.Lazy.Internal.ByteString

2011-03-16 Thread C K Kashyap
I had started exploring the internal - PS constructor route looking at the base64 encoding implementation by Bryan (which is really fast - http://www.serpentine.com/blog/2010/09/02/fast-base64-encoding-and-decoding-in-haskell/)- I was wondering if we don't use the PS constructor can we implement