woboats: I'm not in love with `..=`, but (a) I want the feature and (b) you can blame Ruby's random number generator
Is that what we are talking about?
woboats
it is
I stood aside on ..= because the rest of the lang team was in consensus
shep
I can reassign, if you'd like
It's just one more die roll
Well, actually
it picked you again
then...
it picked nrc
say the word
woboats
assign it to nrc
i want to at least be the last one to check my box which means I can't very well propose the merge
shep
done <3
stick to those principles
behnam joined the channel
porky11 has quit
Zoxc_ joined the channel
acrichto has quit
behnam has quit
Zoxc has quit
behnam joined the channel
Diggsey has quit
Noldorin has quit
behnam has quit
nagisa joined the channel
badmann joined the channel
niconii has quit
japaric has quit
japaric joined the channel
AstralSorcerer has quit
behnam joined the channel
behnam has quit
behnam_ joined the channel
emerentius_the_rusty joined the channel
behnam joined the channel
behnam_ has quit
cp has quit
porky11 joined the channel
behnam has quit
behnam joined the channel
behnam has quit
behnam joined the channel
behnam_ joined the channel
behnam has quit
behnam joined the channel
behnam_ has quit
paulgdp joined the channel
lukaramu joined the channel
behnam has quit
behnam joined the channel
behnam has quit
rkruppe joined the channel
cp joined the channel
porky11 has quit
Noldorin joined the channel
kimundi has quit
kimundi joined the channel
cp has quit
arielby joined the channel
oln joined the channel
Noldorin has quit
rkruppe has quit
oln has quit
niconii joined the channel
behnam joined the channel
behnam has quit
badmann has quit
centril
eddyb: not sure what you meant by the syntax: 'Variant(A, B, C): Enum<T, U>' and how it enables things like data a :-> c where (:+:) :: (a :-> c) -> (b :-> c) -> (Either a b :-> c) ; ...'
eddyb
centril: it's a syntactical transformation but your non-identifier names are very annoying
also the reuse of A and C
I'd use A and R
centril
data PFun a c where Sum :: PFun a c -> PFun b c -> PFun (Either a b) c ..
Rust wouldn't let you reuse type parameter names like Haskell does
A = Either<X, Y>
centril
eddyb: Sum is a variant I take it ?
eddyb
yes
that'd be inside enum PFun<A, R>
centril: literally "the type of the constructor"
centril
Ah, so you use <X, Y> for existential quantification of X & Y
eddyb
yupp
just like Haskell
I mean
if it were a true existential it wouldn't be allowed
centril
eddyb: yea with <X, Y> it becomes immediately obvious to me
eddyb
here it's X = (A as Either).0 and Y = (A as Either).1 (in very pseudo notation)
centril
eddyb: I assume you can also put bounds on X & Y like so: Sum<X: Copy, Y: Copy>(..): ..
If 'where' was involved I think it would come last, like so: Sum<X, Y>(PFun<X, R>, PFun<Y, R>): PFun<Either<X, Y>, R> where X: Copy, Y: Clone,
eddyb
that gets trickier but sure
centril
eddyb: so expand on "if it were a true existential"?
eddyb
the problem is determining variant parameters from the actual enum parameters
they are not "arguments" but a logical variable shorthand for something that we have no syntax for
but we can do with custom traits
Noldorin joined the channel
i.e. trait IsEither { type Left; type Right; const PROOF: Id<Self, Either<Self::Left, Self::Right>>; }
wait what
eternaleye: ^^ associated consts can encode proofs
compile-time dependent records
reminiscent of 1ML?
just not as general
rkruppe-phone joined the channel
centril
eddyb: so I'm not sure I follow on the custom traits thing
hmm... could we express: data TypedExpr where (:::) :: forall t. Eq t => Expr t -> Type t -> TypedExpr ? Perhaps as: enum TypedExpr { TExpr<T: Eq>(Expr<T>, Type<T>), } ?
but implementing it is certainly a breaking change, due to its impact on dropck.
rkruppe-phone joined the channel
rkruppe joined the channel
eddyb
centril: you can pattern-match on types with traits
furthermore, you can prove the types have a certain head!
centril
eddyb: so in the TypedExpr example, I see a problem... We can construct a TypedExpr::TExpr::<ConcreteT>(expr, ty) with a known size, but given a TypedExpr, how could we possibly know the size of TypedExpr?
eddyb: I think I need to see things in a larger context to understand what you mean
behnam joined the channel
behnam_ joined the channel
behnam has quit
chordowl joined the channel
lukaramu has quit
eddyb
centril: my example introduces no existentials/universals
it relies on type pattern-matching
just like in <Iter: Iterator<Item = (A, B)>, A, B> A and B are *not* truly universal
they are Iter::Item.0 and .1
projections
badmann joined the channel
centril
eddyb: interesting; but then TypedExpr would not work I take it?
Diggsey joined the channel
behnam_ has quit
behnam joined the channel
behnam has quit
behnam joined the channel
behnam has quit
behnam joined the channel
behnam_ joined the channel
behnam has quit
eddyb
centril: correct, you'd need a boxed trait object or something