Re: Bang Patterns

2014-04-02 Thread wren romano
On Tue, Apr 1, 2014 at 3:02 PM, Dan Doel dan.d...@gmail.com wrote: Specifically, consider: case Nothing of !(~(Just x)) - 5 Nothing - 12 Now, the way I'd expect this to work, and how I think the spec says it works, is that my Nothing is evaluated, and then the irrefutable

Re: Bang Patterns

2014-04-02 Thread Dan Doel
Filed. Bug #8952. On Wed, Apr 2, 2014 at 3:41 PM, wren romano winterkonin...@gmail.comwrote: On Tue, Apr 1, 2014 at 3:02 PM, Dan Doel dan.d...@gmail.com wrote: Specifically, consider: case Nothing of !(~(Just x)) - 5 Nothing - 12 Now, the way I'd expect this to

RE: bang patterns give fundamentally new capabilities?

2006-12-08 Thread Simon Peyton-Jones
| | Also, is there a way to do something similar but for 'lazy' rather than | | 'seq'? I want something of type | | | | type World__ = State# RealWorld | | | | {-# NOINLINE newWorld__ #-} | | newWorld__ :: a - World__ | | newWorld__ x = realWord# -- ??? | | | | except that I need

Re: bang patterns give fundamentally new capabilities?

2006-12-04 Thread Kirsten Chevalier
On 12/3/06, John Meacham [EMAIL PROTECTED] wrote: On Sat, Dec 02, 2006 at 11:02:28PM +, Simon Peyton-Jones wrote: [snip] | Also, is there a way to do something similar but for 'lazy' rather than | 'seq'? I want something of type | | type World__ = State# RealWorld | | {-# NOINLINE

Re: bang patterns give fundamentally new capabilities?

2006-12-03 Thread John Meacham
On Sat, Dec 02, 2006 at 11:02:28PM +, Simon Peyton-Jones wrote: | I was recently presented with the problem of writing a function like so | | seqInt__ :: forall a . a - Int# - Int# | seqInt__ x y = x `seq` y | | which seems fine, except 'seq' of type forall a b . a - b - b cannot | be

RE: bang patterns give fundamentally new capabilities?

2006-12-02 Thread Simon Peyton-Jones
| I was recently presented with the problem of writing a function like so | | seqInt__ :: forall a . a - Int# - Int# | seqInt__ x y = x `seq` y | | which seems fine, except 'seq' of type forall a b . a - b - b cannot | be applied to an unboxed value. Actually it works fine. Did you try it? Seq

Re: bang patterns give fundamentally new capabilities?

2006-11-30 Thread Tomasz Zielonka
On Thu, Nov 30, 2006 at 08:13:13PM -0800, John Meacham wrote: I was recently presented with the problem of writing a function like so seqInt__ :: forall a . a - Int# - Int# seqInt__ x y = x `seq` y which seems fine, except 'seq' of type forall a b . a - b - b cannot be applied to an

RE: Transformational Patterns?

2006-07-25 Thread Simon Peyton-Jones
| After reading the paper Pattern Guards and Transformational Patterns | by Martin Erwig and Simon Peyton Jones, I'm left wondering about the | status of transformational patterns? Can we expect to see these at | some point in GHC? Or have they gone by the wayside in favor of some | other

RE: Or-patterns

2000-12-06 Thread Simon Peyton-Jones
Sensible suggestion No technical problem, just one more thing to do. If anyone feels inclined to implement it I'll gladly incorporate the fruits of their labours in the GHC code base. Simon | -Original Message- | From: George Russell [mailto:[EMAIL PROTECTED]] | Sent: 04 December 2000

Re: Or-patterns

2000-12-06 Thread Marcin 'Qrczak' Kowalczyk
Mon, 04 Dec 2000 17:17:42 +0100, George Russell [EMAIL PROTECTED] pisze: Where you have variables in the patterns, you bind only the variables which appear in all the patterns, and you unify the types accordingly. Or bind them all (otherwise there would be _ written) and get bottom in case