|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: Type lists and HArrayAdriaan Moors wrote:
> one approach would be to use an "existential value", which is already > supported, in combination with allowing to specify constructor arguments > in a type (not supported): > `B(x forSome {val x: A { type T = Boolean }})`, which could be > abbreviated to `B(_ : A { type T = Boolean })` That would work, but I don't think it's very intuitive. When you write "new B(...)" (and B has no type parameters), it's reasonable to expect it to have type B. > To me, the interesting part of this approach is that it shows how values > and types play together. There are two ways to approach this dilemma: > keep types and values strictly separated, as in Omega (Tim Sheard), or > embrace the dependencies and provide language support for them (Scala, > Coq). In the end, we want to use types to govern the value level, so > the latter approach seems more productive. I definitely think it's preferable to only work with types at the type level. Creating implicit values and functions just to be able to infer a type seems like a backwards and cumbersome way compared to: - built-in type expressions: type F[T1, T2] = (T1 <: T2)#IfElse[Int, Boolean] - type specialization (a la C++): type F[T] = Boolean; type F[T <: Int] = Float - type implicits (and partial application): trait A[T1, T2] {type T = T2}; implicit type IA = A[Int, Boolean]; type F[implicit T2 <: A[Int, _]] = T2#T And there's probably other solutions as well. > More concretely, I'm > interested in exploring how implicit search and type inference relate, > as they both infer entities, albeit at different levels (the former: > values, the latter: types, obviously). How can we describe their > interaction elegantly? How can our type-level hacking benefit from this > interaction? I think the most important step was taken in 2.8 when type parameters could be inferred from implicit parameters. /Jesper Nordenberg |
|
|
Re: Re: Type lists and HArrayFascinating discussion! I wish I could more actively contribute (must say I'm a bit out of my league here), but I was playing around with a type-level implementation of Conway games just the other day and both type equality checks and partial type application would have vastly simplified things.
Keenly following the developments. - Colin |
|
|
Re: Re: Type lists and HArrayDear Colin,
Now that sounds interesting! Is your code for type level Conway games web-accessible? Best wishes, --greg
On Fri, Sep 18, 2009 at 7:06 AM, Colin Bullock <cmbullock@...> wrote: Fascinating discussion! I wish I could more actively contribute (must say I'm a bit out of my league here), but I was playing around with a type-level implementation of Conway games just the other day and both type equality checks and partial type application would have vastly simplified things. -- L.G. Meredith Managing Partner Biosimilarity LLC 1219 NW 83rd St Seattle, WA 98117 +1 206.650.3740 http://biosimilarity.blogspot.com |
|
|
Re: Re: Type lists and HArray
Not currently. At this point, I have little more down in code than some experimenting around to see how far I could push things. I'm definitely stretching the limits of my type-fu here (likely why it's so enjoyable), and have run up against a few walls related to cyclic type definitions and "conditional" types for defining ordering over games. I've also yet to find a satisfactory type to represent sets of positions in games so I've resorted to living with the restriction of only dealing with the greatest and least position for left and right respectively (which potentially seems acceptable for numbers, but likely not so for arbitrary games). If I have some time to put into it, and can satisfy both the compiler and myself, I'd be happy to share what I've come up with on github or somewhere. - Colin |
|
|
Re: Re: Type lists and HArrayGiven this definition of function I haven't had any problem with partial evaluation:
trait F { type apply[_ <: F] <: F }
On Fri, Sep 18, 2009 at 4:06 PM, Colin Bullock <cmbullock@...> wrote: Fascinating discussion! I wish I could more actively contribute (must say I'm a bit out of my league here), but I was playing around with a type-level implementation of Conway games just the other day and both type equality checks and partial type application would have vastly simplified things. |
| Free embeddable forum powered by Nabble | Forum Help |