Avatar
Taketo Sano 4/2/2018 4:06 AM
すいません🙏
4:09 AM
ちなみに自分がやろうとしてできなかったのは、cond. conf. + typealias でできるだけ新しく型を作るのを抑えようとしていたのですが、 public protocol EquivalenceRelation { .. } public struct QuotientSet<X, Rel: EquivalenceRelation>: SetType where X == Rel.Base { .. } public struct ModSubgroupRelation<H: Subgroup>: EquivalenceRelation { .. } public typealias QuotientGroup<G, H: Subgroup> = QuotientSet<G, ModSubgroupRelation<H>> where G == H.Super extension QuotientGroup: Group where X: Group, Rel: ModSubgroupRelation<H> // あっ
4:10 AM
typealias するときに型を包むと、包んだ後のものについては cond. conf. が使えないということに気づいたのでした。 (edited)
4:15 AM
抽象化するとこうなると思います: protocol A {} struct X<T: A> {} struct B<S>: A{} typealias Y<S> = X<B<S>> extension<S> Y where T == B<S> { .. } // コレ (edited)
4:16 AM
generic に typealias した Y を新しい型だと思いたいのですが、そうすると extension できないという。