

GHC 7.6 is now live: poly kinds, dynamic use of cores, numeric type literals... - dons
http://www.haskell.org/ghc/docs/7.6.1/html/users_guide/release-7-6-1.html?7.6.1

======
dons
Much discussion here:
[http://www.reddit.com/r/haskell/comments/zgeen/ghc_761_offic...](http://www.reddit.com/r/haskell/comments/zgeen/ghc_761_officially_released/)

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
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
_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?_

There have been a zillion proposals, but as far as I know, not much actual
consensus or implementation work.

Anecdotally, I've never run into a situation where this was anything more than
a minor annoyance. I don't doubt that it can be a problem under the right set
of circumstances, but I think the issue gets more attention than its magnitude
truly merits. People theorize a lot about the difficulties it can
hypothetically cause, but in practice, it seldom actually manifests itself.

~~~
evmar
In my experience it was a perpetual pain point. Do you namespace all your
field names with a common prefix based on the outer type name? Or do you just
get lucky and not have the names collide?

~~~
hesselink
In the past most people prefixed their field names with the type name.
Nowadays, the most common thing is to put types in their own module, and use
the module system to sort out any conflict. Qualified imports can add a
prefix, but you can also import parts unqualified, or hide one problematic
field.

~~~
mifrai
While I prefer the module solution, it's not always possible when you have
mutually recursive record definitions. Well, technically it is possible - but
it's very unpleasant [1].

[1]
[http://www.haskell.org/ghc/docs/latest/html/users_guide/sepa...](http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-
compilation.html#mutual-recursion)

------
tmhedberg
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.

~~~
sadga
`if` is not a function. [http://www.haskell.org/haskellwiki/If-then-
else#Replace_synt...](http://www.haskell.org/haskellwiki/If-then-
else#Replace_syntactic_sugar_by_a_function)

Functional `if` and `cond` are here:
[http://hackage.haskell.org/packages/archive/cond/0.4.0.1/doc...](http://hackage.haskell.org/packages/archive/cond/0.4.0.1/doc/html/Control-
Conditional.html)

~~~
tmhedberg
Did I suggest that it was a function? If so, I didn't intend to.

~~~
Evbn
'If' is not quite analogous to cond, and 'if' is a bit of a hack, and multiway
is more hack on top, is all I wanted to highlight.

And the cond you wanted has already been here for you.

------
dbaupp
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...](http://www.haskell.org/ghc/docs/7.6.1/html/users_guide/syntax-
extns.html#lambda-case) [2]
[http://hackage.haskell.org/trac/ghc/wiki/LambdasVsPatternMat...](http://hackage.haskell.org/trac/ghc/wiki/LambdasVsPatternMatching)

~~~
aristidb
You can still do \a b -> case (a,b) of ...

~~~
thesz
And, perhaps, use uncurry $ \case ...

