[Haskell-cafe] Re: Making monadic code more concise

2010-11-17 Thread oleg
Let me point out another concern with autolifting: it makes it easy to overlook sharing. In the pure world, sharing is unobservable; not so when effects are involved. Let me take the example using the code posted in your first message: t1 = let x = 1 + 2 in x + x The term t1 is polymorphic

[Haskell-cafe] Re: Making monadic code more concise

2010-11-17 Thread Ling Yang
Thank you for highlighting these problems; I should really test my own code more thoroughly. After reading these most recent examples, the translation to existing monads is definitely too neat, and a lot of semantics of the monad are 'defaulted' on. In particular for the probability monad examples

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-17 Thread Simon Marlow
On 12/11/2010 07:49, Mitar wrote: On Wed, Nov 10, 2010 at 4:48 PM, Simon Marlowmarlo...@gmail.com wrote: You can use maskUninterruptible in GHC 7, but that is not generally recommended, Maybe there should be some function like maskUninterruptibleExceptUser which would mask everything except

Re: [Haskell-cafe] borked windows environment, want to start over

2010-11-17 Thread Henk-Jan van Tuyl
On Wed, 17 Nov 2010 01:39:40 +0100, Michael Litchard mich...@schmong.org wrote: I think I may have borked things good using cygwin. I want to remove it and do a clean install of haskell platform w/out cygwin. What do I need to do to make sure all configuration files have been removed? There

Re: [Haskell-cafe] [ANNOUNCE] Parallel Haskell project underway

2010-11-17 Thread Dmitry Astapov
On Mon, Nov 15, 2010 at 5:44 PM, Neil Brown nc...@kent.ac.uk wrote: On 15/11/10 15:23, Dmitry Astapov wrote: [snip] This is slightly OT, but having used WinBUGS a little, I am very pleased to see this listed as a project. WinBUGS is a commendable piece of work, but is really showing its

[Haskell-cafe] a simple question about types

2010-11-17 Thread Jerzy M
Hallo, let me take this simple function: (2*). If I check its type :t (2*) I'll obtain (2*) :: (Num a) = a - a But now it suffices to write g = (2*) and check :t g to obtain g :: Integer - Integer One more combination, now I write h x = (2*) x and check once more :t h to get h :: (Num a) = a - a

Re: [Haskell-cafe] a simple question about types

2010-11-17 Thread Alexander Solla
On Nov 17, 2010, at 10:09 AM, Jerzy M wrote: So my question is: why (in this second example) Integer is inferred? What makes a difference? I think there are two things going on. First, the monomorphism restriction is causing the types to be different. I'm not sure why Integer -

Re: [Haskell-cafe] a simple question about types

2010-11-17 Thread Daniel Fischer
On Wednesday 17 November 2010 19:09:16, Jerzy M wrote: Hallo, let me take this simple function: (2*). If I check its type :t (2*) I'll obtain (2*) :: (Num a) = a - a But now it suffices to write g = (2*) and check :t g to obtain g :: Integer - Integer One more combination, now I

Re: [Haskell-cafe] a simple question about types

2010-11-17 Thread Ryan Ingram
Now of course, the followup question is what the heck is a monomorphism restriction and why would I want it? Here is a simple example: expensiveComputation :: Num a = a - a expensiveComputation x = ... something that takes a long time to compute ... ghci :t (expensiveComputation 2 *)

Re: [Haskell-cafe] a simple question about types

2010-11-17 Thread Daniel Fischer
On Wednesday 17 November 2010 20:19:17, Ryan Ingram wrote: Now of course, the followup question is what the heck is a monomorphism restriction and why would I want it? Here is a simple example: snip But if you give g the more general type signature, the expensiveComputation has to get run

Re: [Haskell-cafe] borked windows environment, want to start over

2010-11-17 Thread Aaron Gray
On 17 November 2010 15:47, Henk-Jan van Tuyl hjgt...@chello.nl wrote: On Wed, 17 Nov 2010 01:39:40 +0100, Michael Litchard mich...@schmong.org wrote: I think I may have borked things good using cygwin. I want to remove it and do a clean install of haskell platform w/out cygwin. What do I

[Haskell-cafe] Papers discussing interpreters for call by need?

2010-11-17 Thread David Sankel
I'm writing an interpreter for a call by need language and have been doing a direct implementation of the Launchbury semantics. My problem is that in the variable rule, an alpha conversion is done that, as far as I understand, is going to hinder any tail call optimization. I realize that the

Re: [Haskell-cafe] Papers discussing interpreters for call by need?

2010-11-17 Thread David Sabel
As a starting point I would suggest Peter Sestoft : Deriving a lazy abstract machine, Journal of Functional Programming 7(3), 1997 ( http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.4314 ) Different abstract machines for call-by-need evaluation are built starting from Launchburys

Re: [Haskell-cafe] Papers discussing interpreters for call by need?

2010-11-17 Thread David Sankel
Awesome! Thank you. On Wed, Nov 17, 2010 at 4:10 PM, David Sabel sa...@ki.informatik.uni-frankfurt.de wrote: As a starting point I would suggest Peter Sestoft : Deriving a lazy abstract machine, Journal of Functional Programming 7(3), 1997 (

Re: [Haskell-cafe] borked windows environment, want to start over

2010-11-17 Thread Stephen Tetley
Cygwin is fine for development - the shell is Bash (this can probably be changed), so it is much more capable than the MS shell. Personally I've never needed to uninstall Cygwin, if things get in a mess re-running the Cygwin installer seems to sort things out. One caveat is that if you want to

Re: [Haskell-cafe] borked windows environment, want to start over

2010-11-17 Thread Henk-Jan van Tuyl
On Wed, 17 Nov 2010 22:38:54 +0100, Stephen Tetley stephen.tet...@gmail.com wrote: One caveat is that if you want to build Haskell bindings to C libraries, MinGW+MSys is preferable to Cygwin. Cygwin shared libraries depend on the cygwin.dll which generally isn't what you want for bindings.

[Haskell-cafe] How to generalize executing a series of commands, based on a list?

2010-11-17 Thread Peter Schmitz
I am able to use System.Cmd (system) to invoke a shell command and interpret the results. Please see the code below that works okay for one such command. (I invoke a program, passing two args.) I am wondering how to generalize this to do likewise for a series of commands, where the varying args

[Haskell-cafe] Haskell Weekly News: Issue 159 - November 17, 2010

2010-11-17 Thread Daniel Santa Cruz
Welcome to issue 159 of the HWN, a newsletter covering developments in the [1]Haskell community in the week of November 07 - 13. We have a new GHC to celebrate! On November 16 the GHC team announced the [2]release of GHC 7.0.1. Plenty of goodness here, with many bug fixes and

Re: [Haskell-cafe] Haskell Weekly News: Issue 159 - November 17, 2010

2010-11-17 Thread Jake McArthur
On 11/17/2010 09:56 PM, Daniel Santa Cruz wrote: Curious about the most active members of the #haskell IRC channel? Out of around 28K utterances in the channel this week, 24% of them where spoken by the top 5 most active members. Not suprisingly, the dear lambdabot is at the top

[Haskell-cafe] Papers discussing interpreters for call by need?

2010-11-17 Thread oleg
David Sankel wrote: I'm writing an interpreter for a call by need language... Is anyone aware of any papers out there that go into detail on the construction of an actual interpreter? You might find the following call-by-need interpreter useful: