#rust-lang

/

      • eddyb
        JoshTriplett: there *is* one place where we sort of need to add it
      • JoshTriplett: which is, say, unify(for<'a> fn(<T as Trait<'a>>::X), fn(U)) needs to also output for<'a> <T as Trait<'a>>::X == U
      • JoshTriplett: but just impl HashSet<MyStruct> {} doesn't do any unification, because unlike Haskell (I guess?), there is no type at the declaration site, but rather a name and generic parameters
      • JoshTriplett: so you're *instantiating* HashSet with K = MyStruct
      • JoshTriplett: which results in a type that looks like Adt(HashSet, [MyStruct])
      • JoshTriplett: and none of that sees the bounds of HashSet
      • WF is responsible for dealing with things like that, and that runs *later* (because you need to be able to understand all the types ahead of checking they're WF)
      • JoshTriplett: oh let me rephrase something :)
      • JoshTriplett: struct HashSet<K: Hash> {} is actually struct HashSet<K> where K: Hash {} *not the other way around*
      • JoshTriplett
        eddyb: I guess I really don't want there to be a difference between those two.
      • I always thought they were just syntactically different, not semantically different.
      • eddyb
        JoshTriplett: the former desugars into the latter, effectively
      • JoshTriplett
        That's fine.
      • eddyb
        i.e. forall a.(Hash a) => HashSet a. but Haskell is really bad at this anyway
      • (I get angry every time I have to deal with its conflation of 2-3 concepts within the same syntax)
      • frankly I think QWERTY was a mistake
      • and we should all have ∃, ∀ & Λ on our keyboards
      • I bet you teens would be using them instead of less precise shorthands
      • well, not Λ unless they're doing higher-order texting
      • JoshTriplett has quit
      • niconii joined the channel
      • srwalker101 joined the channel
      • JoshTriplett joined the channel
      • woboats joined the channel
      • cramertj_ has quit
      • JoshTriplett
        eddyb: I was thinking more about `data Hash a => HashSet a" (or similar syntax using GADTs or similar).
      • srwalker101 has quit
      • eddyb
        JoshTriplett: there's an implied list of one element, a, in there
      • srwalker101 joined the channel
      • JoshTriplett: not sure there's a way to write it in Haskell. I know forall exists but not its semantics in this case
      • JoshTriplett: but anyway, even in Haskell, "Hash a" is a bound that happens to be syntactically placed before HashSet a
      • oh I guess the list is not implicit, it's HashSet a?
      • depends how complete that example is :P
      • JoshTriplett: anyway, the bound is not inherent to a, it just *uses* a
      • JoshTriplett
        eddyb: It's been a while since I wrote actual Haskell code. :)
      • eddyb
        JoshTriplett: this is even more true in Haskell where there is no asymmetry
      • struct HashSet(K) where Hash(K)
      • srwalker101 has quit
      • JoshTriplett: anyway this is all minutia :P
      • srwalker101 joined the channel
      • srwalker101 has quit
      • cramertj_ joined the channel
      • srwalker101 joined the channel
      • srwalker101 has quit
      • cramertj_ has quit
      • brson joined the channel
      • JoshTriplett has quit
      • AstralSorcerer has quit
      • AstralSorcerer joined the channel