Re: A possible alternative to dot notation for record access

2013-07-01 Thread John Wiegley
Edward Kmett ekm...@gmail.com writes: If you really want to hunt for unused syntax and we wind up needing a (.) analogue then (-) is currently a reserved operator, so opening it up for use at the term level could be made to work, and there is a precedent with c/c++ pointer dereferencing.

Re: Overloaded record fields

2013-07-01 Thread Barney Hilken
(sorry, accidentally failed to send this to the list) All this extra syntax, whether it's ., #, or {} seems very heavy for a problem described as very rare. Why not simply use a declaration field name whose effect is to declare name :: r {name ::t} = r - t name =

Exposing newtype coercions to Haskell

2013-07-01 Thread Joachim Breitner
Hi, this is related to http://hackage.haskell.org/trac/ghc/wiki/NewtypeWrappers#Proposal3. I tried to hack up a little prototype of this, and this “works” now: import GHC.NT newtype Age = Age Int deriving Show ageNT :: NT Age Int ageNT = createNT

Re: Overloaded record fields

2013-07-01 Thread Adam Gundry
Hi all, I have amended the plan [1] as a result of the ongoing discussion, including leaving the syntax alone for the time being, so record projections are written prefix. Regarding Barney's suggestion of field declarations: On 01/07/13 10:50, Barney Hilken wrote: All this extra syntax,

Re: A possible alternative to dot notation for record access

2013-07-01 Thread Edward A Kmett
Sure. I'd rather have nothing, but at least unlike the (.) proposals it doesn't break existing code. That said I don't think we need either. On Jul 1, 2013, at 2:27 AM, John Wiegley jo...@fpcomplete.com wrote: Edward Kmett ekm...@gmail.com writes: If you really want to hunt for unused

Field accessor type inference woes

2013-07-01 Thread Edward Kmett
It strikes me that there is a fairly major issue with the record proposal as it stands. Right now the class class Has (r :: *) (x :: Symbol) (t :: *) can be viewed as morally equivalent to having several classes class Foo a b where foo :: a - b class Bar a b where bar

Re: PSA: GHC can now be built with Clang

2013-07-01 Thread Ryan Newton
By the way, on the topic of these preformance comparisons -- has anyone tried building the RTS with the Intel C compiler? (They try very hard at being a drop-in GHC replacement.) ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

Re: PSA: GHC can now be built with Clang

2013-07-01 Thread Ryan Newton
Err, GCC replacement. But, ironically, GHC [backend] replacement as well, as of the recent ICFP paper. On Mon, Jul 1, 2013 at 12:03 PM, Ryan Newton rrnew...@gmail.com wrote: By the way, on the topic of these preformance comparisons -- has anyone tried building the RTS with the Intel C

Re: Field accessor type inference woes

2013-07-01 Thread Adam Gundry
Hi Edward, I was envisaging that we might well need a functional dependency class Has (r :: *) (x :: Symbol) (t :: *) | r x - t and, as you point out, composition of polymorphic accessors certainly motivates this. Isn't that enough, though? I think it works out more neatly than the type family

Re: Field accessor type inference woes

2013-07-01 Thread Edward Kmett
On Mon, Jul 1, 2013 at 1:07 PM, Adam Gundry adam.gun...@strath.ac.ukwrote: Hi Edward, I was envisaging that we might well need a functional dependency class Has (r :: *) (x :: Symbol) (t :: *) | r x - t and, as you point out, composition of polymorphic accessors certainly motivates this.