[Haskell-cafe] Eta Reduction

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Wed Apr 2 14:15:03 UTC 2014


On Wed, Apr 02, 2014 at 09:51:46AM -0400, Edward Kmett wrote:
> Consider something like
> 
> data Foo a = Foo !Int !a
> 
> The data constructor Foo needs to be strict in its arguments, so it'd need Seq
> Int and Seq a. Seq Int would be resolved by the environment, but Seq a would
> need to come from somewhere.
> 
> data Seq a => Foo a = Foo !Int !a

Oh right, I didn't realise that's what you meant by "patterns".  I assumed
you were talking about let or function definitions.

> On Wed, Apr 2, 2014 at 3:08 AM, Tom Ellis <
> tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
> > On Tue, Apr 01, 2014 at 05:32:45PM -0400, Edward Kmett wrote:
> > > Unfortunately the old class based solution also carries other baggage,
> > > like the old data type contexts being needed in the language for bang
> > > patterns.  :(
> >
> > Can you explain why that is so?  I don't understand.


More information about the Haskell-Cafe mailing list