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
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
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
| 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
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,
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 :: * - * - * - *) =
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
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
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
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
10 matches
Mail list logo