Re: Proposals and owners

2009-08-20 Thread Ross Paterson
On Thu, Aug 20, 2009 at 01:45:08PM +0100, Simon Marlow wrote:
> On 08/08/2009 10:24, Ross Paterson wrote:
> >On Sat, Aug 08, 2009 at 10:09:38AM +0100, Iavor Diatchki wrote:
> >>I thought that the intended semantics was supposed to be that the only
> >>element is bottom (hence the proposal to add a related empty case
> >>construct)?
> >
> >If that were the case, a compiler could legitimately discard any value
> >of such a type, because it could be easily reconstructed.  I don't
> >think that is what is intended.
> 
> Just in case this question is still open: an empty data declaration
> declares a type that has exactly zero constructors, not an abstract
> type.  What would it mean to define an abstract types?  Haskell only
> allows one definition of any given type.

Yes, I take it back.  Such types are typically used as phantom type
arguments, e.g. the argument of Ptr, so the question I raised doesn't
arise.
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-08-20 Thread Simon Marlow

On 08/08/2009 10:24, Ross Paterson wrote:

On Sat, Aug 08, 2009 at 10:09:38AM +0100, Iavor Diatchki wrote:

I thought that the intended semantics was supposed to be that the only
element is bottom (hence the proposal to add a related empty case
construct)?


If that were the case, a compiler could legitimately discard any value
of such a type, because it could be easily reconstructed.  I don't
think that is what is intended.


Just in case this question is still open: an empty data declaration 
declares a type that has exactly zero constructors, not an abstract 
type.  What would it mean to define an abstract types?  Haskell only 
allows one definition of any given type.


Cheers,
Simon
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-08-08 Thread Isaac Dupree

Ross Paterson wrote:

On Sat, Aug 08, 2009 at 10:09:38AM +0100, Iavor Diatchki wrote:

I thought that the intended semantics was supposed to be that the only
element is bottom (hence the proposal to add a related empty case
construct)?


If that were the case, a compiler could legitimately discard any value
of such a type, because it could be easily reconstructed.  I don't
think that is what is intended.


Actually, I think it is.  I think that's a natural consequence of the 
way Haskell is specified.  GHC tries to pick the kind of bottom that you 
expected, but it doesn't always work really well, because it's not 
actually specified in any sort of formal way...


Now, with imprecise exceptions, I'm not sure a compiler could 
legitimately discard the value.


(by the way, for a type that you can unsafeCoerce anything to, GHC has a 
special type named "Any". Which is not the same as a data type with no 
constructors.)


-Isaac
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-08-08 Thread Ross Paterson
On Sat, Aug 08, 2009 at 10:09:38AM +0100, Iavor Diatchki wrote:
> I thought that the intended semantics was supposed to be that the only
> element is bottom (hence the proposal to add a related empty case
> construct)?

If that were the case, a compiler could legitimately discard any value
of such a type, because it could be easily reconstructed.  I don't
think that is what is intended.
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-08-08 Thread Iavor Diatchki
I thought that the intended semantics was supposed to be that the only
element is bottom (hence the proposal to add a related empty case
construct)?

On Thu, Aug 6, 2009 at 3:49 PM, Ross Paterson wrote:
> On Wed, Jul 29, 2009 at 02:34:26PM -0400, Stephanie Weirich wrote:
>> Ok, I've put together a page on EmptyDataDecls:
>>
>> http://hackage.haskell.org/trac/haskell-prime/wiki/EmptyDataDecls
>
> I think this needs a sentence about semantics, to the effect that the
> type is abstract.  (Not that its only element is bottom.)
> ___
> Haskell-prime mailing list
> Haskell-prime@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-prime
>
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-08-06 Thread Ross Paterson
On Wed, Jul 29, 2009 at 02:34:26PM -0400, Stephanie Weirich wrote:
> Ok, I've put together a page on EmptyDataDecls:
> 
> http://hackage.haskell.org/trac/haskell-prime/wiki/EmptyDataDecls

I think this needs a sentence about semantics, to the effect that the
type is abstract.  (Not that its only element is bottom.)
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-08-03 Thread Simon Marlow

So is there a volunteer to flesh out the details of a proposal?

On 31/07/2009 16:53, Iavor Diatchki wrote:

+1. I completely agree.

On Fri, Jul 31, 2009 at 6:04 PM, Lennart
Augustsson  wrote:

I think that a natural extension to allowing empty data declarations
would be to allow empty case expressions.

On Wed, Jul 29, 2009 at 7:34 PM, Stephanie
Weirich  wrote:

Ok, I've put together a page on EmptyDataDecls:

http://hackage.haskell.org/trac/haskell-prime/wiki/EmptyDataDecls

Cheers,
Stephanie
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-08-03 Thread Simon Marlow

On 02/08/2009 22:38, Niklas Broberg wrote:

I updated the code on the wiki page: the previous version didn't handle
prefix negation - did you implement that yourself in HLint?


No, I didn't implement prefix negation in HLint - it never came up as
an issue. Perhaps the underlying HSE library dealt with it for me -
Niklas would know.


In haskell-src-exts (and haskell-src, since that's inherited), unary
minus binds tighter than any infix operator:


exp0b :: { PExp }
   : exp0b qop exp10b  { InfixApp $1 $2 $3 }
   | dvarexp   { $1 }
   | exp10b{ $1 }



exp10b :: { PExp }
   : 'case' exp 'of' altslist  { Case $2 $4 }
   | '-' fexp  { NegApp $2 }
   | 'do' stmtlist { Do $2 }
   | 'mdo' stmtlist{ MDo $2 }
   | fexp  { $1 }


It has never come up as a problem. Guess that's a point in case for
getting rid of unary minus as an operator. :-)


I think someone should propose this change for next year's Haskell 
revision.  We have evidence that (a) the current precedence of prefix 
negation is confusing, and (b) it is rarely relied upon.


Changing the syntax as above is better IMO than the suggestion in

http://hackage.haskell.org/trac/haskell-prime/wiki/NegativeSyntax

to move prefix negation into the lexical syntax of numbers.

Cheers,
Simon
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-08-02 Thread Niklas Broberg
>> I updated the code on the wiki page: the previous version didn't handle
>> prefix negation - did you implement that yourself in HLint?
>
> No, I didn't implement prefix negation in HLint - it never came up as
> an issue. Perhaps the underlying HSE library dealt with it for me -
> Niklas would know.

In haskell-src-exts (and haskell-src, since that's inherited), unary
minus binds tighter than any infix operator:

> exp0b :: { PExp }
>   : exp0b qop exp10b  { InfixApp $1 $2 $3 }
>   | dvarexp   { $1 }
>   | exp10b{ $1 }

> exp10b :: { PExp }
>   : 'case' exp 'of' altslist  { Case $2 $4 }
>   | '-' fexp  { NegApp $2 }
>   | 'do' stmtlist { Do $2 }
>   | 'mdo' stmtlist{ MDo $2 }
>   | fexp  { $1 }

It has never come up as a problem. Guess that's a point in case for
getting rid of unary minus as an operator. :-)

Cheers,

/Niklas
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-08-02 Thread Neil Mitchell
  >  remove FixityResolution from the context-free grammar
>>>
>>> http://hackage.haskell.org/trac/haskell-prime/wiki/FixityResolution
>>>
>>> Please take a look and comment.  This fixes a nasty bug in the Haskell
>>> syntax - albeit one that doesn't cause problems in practice, but still.
>>>  I
>>> think the changes make the grammar look nicer, and help compiler
>>> implementers by providing a sample implementation of fixity resolution.
>>>
>>> We better be sure the sample implementation is correct!  I've tested it
>>> fairly well, but I wouldn't rule out corner cases being wrong, especially
>>> with prefix negation.
>>
>> The code in Resolve.hs has been used by HLint for months, and is the
>> basis of the resolution used in haskell-src-exts 1.0.0. In that time I
>> haven't seen any bugs with the fixity resolution.
>
> I updated the code on the wiki page: the previous version didn't handle
> prefix negation - did you implement that yourself in HLint?

No, I didn't implement prefix negation in HLint - it never came up as
an issue. Perhaps the underlying HSE library dealt with it for me -
Niklas would know.

Thanks

Neil
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-07-31 Thread Iavor Diatchki
+1. I completely agree.

On Fri, Jul 31, 2009 at 6:04 PM, Lennart
Augustsson wrote:
> I think that a natural extension to allowing empty data declarations
> would be to allow empty case expressions.
>
> On Wed, Jul 29, 2009 at 7:34 PM, Stephanie
> Weirich wrote:
>> Ok, I've put together a page on EmptyDataDecls:
>>
>> http://hackage.haskell.org/trac/haskell-prime/wiki/EmptyDataDecls
>>
>> Cheers,
>> Stephanie
>> ___
>> Haskell-prime mailing list
>> Haskell-prime@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-prime
>>
> ___
> Haskell-prime mailing list
> Haskell-prime@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-prime
>
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-07-31 Thread Lennart Augustsson
I think that a natural extension to allowing empty data declarations
would be to allow empty case expressions.

On Wed, Jul 29, 2009 at 7:34 PM, Stephanie
Weirich wrote:
> Ok, I've put together a page on EmptyDataDecls:
>
> http://hackage.haskell.org/trac/haskell-prime/wiki/EmptyDataDecls
>
> Cheers,
> Stephanie
> ___
> Haskell-prime mailing list
> Haskell-prime@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-prime
>
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-07-31 Thread Simon Marlow

On 31/07/2009 14:51, Neil Mitchell wrote:

Hi


  >  remove FixityResolution from the context-free grammar


http://hackage.haskell.org/trac/haskell-prime/wiki/FixityResolution

Please take a look and comment.  This fixes a nasty bug in the Haskell
syntax - albeit one that doesn't cause problems in practice, but still.  I
think the changes make the grammar look nicer, and help compiler
implementers by providing a sample implementation of fixity resolution.

We better be sure the sample implementation is correct!  I've tested it
fairly well, but I wouldn't rule out corner cases being wrong, especially
with prefix negation.


The code in Resolve.hs has been used by HLint for months, and is the
basis of the resolution used in haskell-src-exts 1.0.0. In that time I
haven't seen any bugs with the fixity resolution.


I updated the code on the wiki page: the previous version didn't handle 
prefix negation - did you implement that yourself in HLint?


Cheers,
Simon
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-07-31 Thread Neil Mitchell
Hi

>>  > remove FixityResolution from the context-free grammar
>
> http://hackage.haskell.org/trac/haskell-prime/wiki/FixityResolution
>
> Please take a look and comment.  This fixes a nasty bug in the Haskell
> syntax - albeit one that doesn't cause problems in practice, but still.  I
> think the changes make the grammar look nicer, and help compiler
> implementers by providing a sample implementation of fixity resolution.
>
> We better be sure the sample implementation is correct!  I've tested it
> fairly well, but I wouldn't rule out corner cases being wrong, especially
> with prefix negation.

The code in Resolve.hs has been used by HLint for months, and is the
basis of the resolution used in haskell-src-exts 1.0.0. In that time I
haven't seen any bugs with the fixity resolution.

Thanks, Neil
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-07-31 Thread Simon Marlow

I have fleshed out the report delta for


 > remove FixityResolution from the context-free grammar


http://hackage.haskell.org/trac/haskell-prime/wiki/FixityResolution

Please take a look and comment.  This fixes a nasty bug in the Haskell 
syntax - albeit one that doesn't cause problems in practice, but still. 
 I think the changes make the grammar look nicer, and help compiler 
implementers by providing a sample implementation of fixity resolution.


We better be sure the sample implementation is correct!  I've tested it 
fairly well, but I wouldn't rule out corner cases being wrong, 
especially with prefix negation.


Cheers,
Simon
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


empty decls Re: Proposals and owners

2009-07-30 Thread Christian Maeder
Stephanie Weirich wrote:
> Ok, I've put together a page on EmptyDataDecls:
> 
> http://hackage.haskell.org/trac/haskell-prime/wiki/EmptyDataDecls

This reminds me to the related ticket:
http://hackage.haskell.org/trac/ghc/ticket/393

If a dummy definition can be supplied for a function, then also a dummy
constructor value can be supplied for a data type.

If empty bindings and/or data types are supported the compiler can at
least better warn about them.

Cheers Christian

___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-07-29 Thread Stephanie Weirich

Ok, I've put together a page on EmptyDataDecls:

http://hackage.haskell.org/trac/haskell-prime/wiki/EmptyDataDecls

Cheers,
Stephanie
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-07-11 Thread Ross Paterson
I've had a go at #65 RelaxedDependencyAnalysis:

http://hackage.haskell.org/trac/haskell-prime/wiki/RelaxedDependencyAnalysis
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-07-09 Thread Simon Marlow

We still need owners for:

On 08/07/2009 10:07, Simon Marlow wrote:


 > Remove n+k patterns
 > NonDecreasingIndentation


Cheers,
Simon
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Proposals and owners

2009-07-08 Thread Ross Paterson
On Wed, Jul 08, 2009 at 10:07:21AM +0100, Simon Marlow wrote:
> As a reminder, here is the provisional list for 2010:
>
> > ForeignFunctionInterface
> > LineCommentSyntax
> > PatternGuards
> > DoAndIfThenElse
> > Remove n+k patterns
> > RelaxedDependencyAnalysis
> > EmptyDataDeclarations
> > HierarchicalModules
> > NonDecreasingIndentation
> > remove FixityResolution from the context-free grammar
> > change the syntax of QualifiedOperators
>
> These have already been done, so don't really need owners:
>
> > LineCommentSyntax
> > DoAndIfThenElse
> > PatternGuards
>
> I plan to take ownership of the following:
>
> > HierarchicalModules
> > change the syntax of QualifiedOperators
> > remove FixityResolution from the context-free grammar
>
> That leaves the following proposals needing owners:
>
> > ForeignFunctionInterface
> > Remove n+k patterns
> > RelaxedDependencyAnalysis
> > EmptyDataDeclarations
> > NonDecreasingIndentation
>
> Volunteers please!

I'll volunteer for RelaxedDependencyAnalysis -- it's mostly done already.
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime