Re: Repeated variables in type family instances

2013-06-26 Thread Dominique Devriese
Richard, Thanks for your answers. 2013/6/24 Richard Eisenberg e...@cis.upenn.edu: The nub of the difference is that type families can pattern-match on kinds, whereas term-level functions cannot pattern-match on types. So, while the @a is repeated in the pattern as written above, GHC does

Re: PSA: GHC can now be built with Clang

2013-06-26 Thread Carter Schonwald
Isaac, Austin and I have actually just been email introduced to Tom, so excellent timing :) Happily, we've got a direct contact with the apple folks working on llvm / clang via a friend of mine, and thus in turn Tom and some others. The most important piece is making sure the Clang patches land

Re: Overloaded record fields

2013-06-26 Thread Dominique Devriese
I think it's a good idea to push forward on the records design because it seems futile to hope for an ideal consensus proposal. The only thing I dislike though is that dot notation is special-cased to record projections. I would prefer to have dot notation for a general, very tightly-binding

RE: Overloaded record fields

2013-06-26 Thread Simon Peyton-Jones
| record projections. I would prefer to have dot notation for a | general, very tightly-binding reverse application, and the type of the record | selector for a field f changed to forall r t. r { f :: t } = r - t | instead of SomeRecordType - t. Such a general reverse application dot would

Re: Overloaded record fields

2013-06-26 Thread Edward Kmett
Note: the lens solution already gives you 'reverse function application' with the existing (.) due to CPS in the lens type. -Edward On Wed, Jun 26, 2013 at 4:39 PM, Simon Peyton-Jones simo...@microsoft.comwrote: | record projections. I would prefer to have dot notation for a | general,

Re: Repeated variables in type family instances

2013-06-26 Thread Richard Eisenberg
Sure. Say you want a default type at any given kind. You could write something like this: type family Default (a :: k) :: k type instance Default (a :: *) = () type instance Default (a :: * - *) = [] type instance Default (a :: * - * - *) = (,) type instance Default (a :: * - * - * - *) =

Re: Overloaded record fields

2013-06-26 Thread AntC
Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk writes: On 24/06/13 11:04, Roman Cheplyaka wrote: * Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk [2013-06-24 10:47:09+0100] Restricting function composition to have spaces around it will require changing a large amount of existing code if

Re: Overloaded record fields

2013-06-26 Thread AntC
Simon Peyton-Jones simonpj at microsoft.com writes: | record projections. I would prefer to have dot notation for a | general, very tightly-binding reverse application, ... | Such a general reverse application dot would | allow things like string.toUpper and for me personally, it would

Re: Overloaded record fields

2013-06-26 Thread AntC
person.lastName.toUpper-- == toUpper (lastName person) Oops! that should be one of: person.lastName.head.toUpper person.lastName.(map toUpper) ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: Overloaded record fields

2013-06-26 Thread Edward Kmett
Let me take a couple of minutes to summarize how the lens approach tackles the composition problem today without requiring confusing changes in the lexical structure of the language. I'll digress a few times to showcase how this actually lets us make more powerful tools than are available in