Re: [Haskell-cafe] explicit annotations on kind polymorphism for data types

2012-08-22 Thread José Pedro Magalhães
Nope, but it should work on 7.6 (also on the release candidate). The 'X' should be lowercase, though, like type variables. Cheers, Pedro On Wed, Aug 22, 2012 at 12:01 AM, dude d...@methodeutic.com wrote: Hello All: I'm working through Giving Haskell a Promotion. Section 2.4 presents an

[Haskell-cafe] How to implement instance of MonadBaseControl IO

2012-08-22 Thread yi huang
I have a `newtype Yun a = Yun { unYun :: ReaderT YunEnv (ResourceT IO) a }` , and i need to define an instance of `MonadBaseControl IO` for it. Newtype instance deriving don't work here. I guess the answer is simple, i just can't figure it out, hope anybody can lightening me. Best regards.

Re: [Haskell-cafe] How to implement instance of MonadBaseControl IO

2012-08-22 Thread Chris Wong
On Wed, Aug 22, 2012 at 7:16 PM, yi huang yi.codepla...@gmail.com wrote: I have a `newtype Yun a = Yun { unYun :: ReaderT YunEnv (ResourceT IO) a }` , and i need to define an instance of `MonadBaseControl IO` for it. Newtype instance deriving don't work here. I guess the answer is simple, i

[Haskell-cafe] Rigid skolem type variable escaping scope

2012-08-22 Thread Matthew Steele
While working on a project I have come across a new-to-me corner case of the type system that I don't think I understand, and I am hoping that someone here can enlighten me. Here's a minimal setup. Let's say I have some existing code like this: {-# LANGUAGE Rank2Types #-} class

Re: [Haskell-cafe] Cloud Haskell real usage example

2012-08-22 Thread Edsko de Vries
Hi Thiago, Let me address your questions one by one. On Wed, Aug 22, 2012 at 1:01 AM, Thiago Negri evoh...@gmail.com wrote: Hello everyone. I'm taking my first steps in Cloud Haskell and got some unexpected behaviors. I used the code from Raspberry Pi in a Haskell Cloud [1] as a first

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-22 Thread Leon Smith
I think we actually agree more than we disagree; I do think distinguishing hard and soft upper bounds (no matter what they are called) would help, and I'm just trying to justify them to some of the more dismissive attitudes towards the idea The only thing I think we (might) disagree on is the

Re: [Haskell-cafe] explicit annotations on kind polymorphism for data types

2012-08-22 Thread Brent Yorgey
I believe in the paper it is actually a lowercase Greek chi (χ), which should work too. ;) -Brent On Wed, Aug 22, 2012 at 08:15:48AM +0200, José Pedro Magalhães wrote: Nope, but it should work on 7.6 (also on the release candidate). The 'X' should be lowercase, though, like type variables.

Re: [Haskell-cafe] Rigid skolem type variable escaping scope

2012-08-22 Thread Simon Peyton-Jones
| This compiles just fine, as I would expect. But now let's say I want | to change it to make IntFn a newtype: | | newtype IntFn a = IntFn (a - Int) | | bar :: (forall a. (FooClass a) = IntFn a) - Bool | bar (IntFn fn) = foo fn The easiest way is to imagine transforming the

Re: [Haskell-cafe] regex-pcre is not working with UTF-8

2012-08-22 Thread José Romildo Malaquias
On Tue, Aug 21, 2012 at 05:50:44PM -0300, José Romildo Malaquias wrote: On Tue, Aug 21, 2012 at 04:05:28PM +0100, Chris Kuklewicz wrote: I do not have time to test this myself right now. But I will unravel my code a bit for you. By November 2011 it worked without problems in my

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-22 Thread David Menendez
As I see it, there are four possibilities for a given version of dependency: 1. The version DOES work. The author (or some delegate) has compiled the package against this version and the resulting code is considered good. 2. The version SHOULD work. No one has tested against this version, but the

Re: [Haskell-cafe] Rigid skolem type variable escaping scope

2012-08-22 Thread Lauri Alanko
Quoting Matthew Steele mdste...@alum.mit.edu: {-# LANGUAGE Rank2Types #-} class FooClass a where ... foo :: (forall a. (FooClass a) = a - Int) - Bool foo fn = ... newtype IntFn a = IntFn (a - Int) bar :: (forall a. (FooClass a) = IntFn a) - Bool bar (IntFn fn)

Re: [Haskell-cafe] Rigid skolem type variable escaping scope

2012-08-22 Thread Matthew Steele
On Aug 22, 2012, at 3:02 PM, Lauri Alanko wrote: Quoting Matthew Steele mdste...@alum.mit.edu: {-# LANGUAGE Rank2Types #-} class FooClass a where ... foo :: (forall a. (FooClass a) = a - Int) - Bool foo fn = ... newtype IntFn a = IntFn (a - Int) bar :: (forall

[Haskell-cafe] Conduit: Where to run monad stacks?

2012-08-22 Thread Niklas Hambüchen
Today I was surprised that transPipe is called for every chunk of data going through my pipe, rendering the StateT I put in useless, because it was always restarted with the initial value. It would be nice to have some explanation about this, as it makes it easy to write compiling code that has

Re: [Haskell-cafe] Rigid skolem type variable escaping scope

2012-08-22 Thread Erik Hesselink
On Wed, Aug 22, 2012 at 10:13 PM, Matthew Steele mdste...@alum.mit.edu wrote: On Aug 22, 2012, at 3:02 PM, Lauri Alanko wrote: Quoting Matthew Steele mdste...@alum.mit.edu: {-# LANGUAGE Rank2Types #-} class FooClass a where ... foo :: (forall a. (FooClass a) = a - Int) - Bool

Re: [Haskell-cafe] Rigid skolem type variable escaping scope

2012-08-22 Thread Lauri Alanko
Quoting Matthew Steele mdste...@alum.mit.edu: 1) bar ifn = case ifn of IntFn fn - foo fn 2) bar ifn = foo (case ifn of IntFn fn - fn) I can't help feeling like maybe I am missing some small but important piece from my mental model of how rank-2 types work. As SPJ suggested, translation to

Re: [Haskell-cafe] Conduit: Where to run monad stacks?

2012-08-22 Thread Felipe Almeida Lessa
I can't give you a definite answer. However, I guess that's because the monad sequencing (i.e. where = of your monad is called) is inside the 'pipe' function [1] (i.e., $$, $=, =$), the function that connects pipes and runs them. 'pipe' needs to be able to interleave lifted actions between both

Re: [Haskell-cafe] Rigid skolem type variable escaping scope

2012-08-22 Thread Matthew Steele
On Aug 22, 2012, at 4:32 PM, Erik Hesselink wrote: On Wed, Aug 22, 2012 at 10:13 PM, Matthew Steele mdste...@alum.mit.edu wrote: On Aug 22, 2012, at 3:02 PM, Lauri Alanko wrote: Quoting Matthew Steele mdste...@alum.mit.edu: {-# LANGUAGE Rank2Types #-} class FooClass a where ...

[Haskell-cafe] Haskell Weekly News: Issue 241

2012-08-22 Thread Daniel Santa Cruz
Welcome to issue 241 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the week of August 12 to 18, 2012. Quotes of the Week * monochrom: seq is a suggestion. pseq is an order. * johnw: Haskell is like using a finely

Re: [Haskell-cafe] Cloud Haskell real usage example

2012-08-22 Thread Thiago Negri
| I have pasted a version of your code that uses Template Haskell at | http://hpaste.org/73520. Where did you get stuck? Your version worked like a charm. I'm quite new to Haskell, so I was trying desperately to get TH working: forgot to quote worker at mkClosure. | 1. A bug in the