top | item 4488869

GHC 7.6 is now live: poly kinds, dynamic use of cores, numeric type literals...

145 points| dons | 13 years ago |haskell.org

26 comments

order
[+] dons|13 years ago|reply
Much discussion here: http://www.reddit.com/r/haskell/comments/zgeen/ghc_761_offic...

Highlights:

* RTS now supports changing the number of capabilities at runtime

* Dataflow based code gen is on

* Unboxed tuples (register allocated structs) are now first class

* Multi-way if syntax

* Lambda case syntax

* Type level naturals and strings

[+] sixbrx|13 years ago|reply
I've been away from Haskell for a while, it's great to see interesting things still being done. Wondering what the use of type-level naturals in Haskell is though? I dabbled with Agda a bit where they're used to satisfy the termination checker, is that sort of thing being done in Haskell now?

Also one thing that always gave me pause about Haskell was the record system, and the inability to have fields with the same name in the same module (especially when the fields are generated from a database). Has there been any progress on that front?

[+] tmhedberg|13 years ago|reply
Every new GHC release is like a little Christmas morning! The pace of new feature development impresses me.

I'm particularly interested in the new type-level literals (which seem like they will make it much less cumbersome to express certain static constraints) and the convenient new syntax for multi-way if expressions (I've long wanted Lisp's `cond` in Haskell) and case analysis on lambda arguments.

[+] dbaupp|13 years ago|reply
Does anyone know how multiple arguments work with lambda-case[1]? Is the solution just using a tuple and manually currying like so (suggested here[2])?

   curry (\case (Nothing,_) -> ...)
(It seems like this would defeat the purpose of lambda-case for lambdas with more than 2 arguments, and it is awkward even for those with exactly 2 arguments.)

[1] http://www.haskell.org/ghc/docs/7.6.1/html/users_guide/synta... [2] http://hackage.haskell.org/trac/ghc/wiki/LambdasVsPatternMat...

[+] JoshTriplett|13 years ago|reply
Yes, LambdaCase only supports one argument. That covers the most common cases, such as foo >>= \case ...

See the discussions at http://hackage.haskell.org/trac/ghc/ticket/4359 and https://unknownparallel.wordpress.com/2012/07/09/the-long-an... for the history of this.

Multi-argument lambda case proves quite difficult to handle sanely, because normal non-lambda case doesn't do multiple arguments, just tuples. Having multiple arguments requires separating the pattern for each argument somehow, a problem that doesn't come up for non-lambda cases.

[+] emillon|13 years ago|reply
The equivalent construct in OCaml is "function", and it suffers from the same limitation, and it's quite idiomatic to match on a tuple.
[+] aristidb|13 years ago|reply
You can still do \a b -> case (a,b) of ...