Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Fix2 {
- type Fix2_1[F1[_, _], F2[_, _]]
- type Fix2_2[F1[_, _], F2[_, _]]
- final class Subst[F1[_, _], F2[_, _]] {
- type Apply[H[_, _]] = H[F1, F2]
- type ApplyF[H[_, _]] = H[Apply[Fix2_1], Apply[Fix2_2]]
- def _1[H[_]](f: H[Apply[Fix2_1]]): H[ApplyF[F1]] = f.asInstanceOf[H[ApplyF[F1]]]
- def _2[H[_]](f: H[Apply[Fix2_2]]): H[ApplyF[F2]] = f.asInstanceOf[H[ApplyF[F2]]]
- }
- private[this] val _subst = new Subst[Any, Any]
- def subst[F1[_, _], F2[_, _]]: Subst[F1, F2] = _subst.asInstanceOf[Subst[F1, F2]]
- }
- object Fix3 {
- type Fix3_1[F1[_, _, _], F2[_, _, _], F3[_, _, _]]
- type Fix3_2[F1[_, _, _], F2[_, _, _], F3[_, _, _]]
- type Fix3_3[F1[_, _, _], F2[_, _, _], F3[_, _, _]]
- final class Subst[F1[_, _, _], F2[_, _, _], F3[_, _, _]] {
- type Apply[H[_, _, _]] = H[F1, F2, F3]
- type ApplyF[H[_, _, _]] = H[Apply[Fix3_1], Apply[Fix3_2], Apply[Fix3_3]]
- def _1[H[_]](f: H[Apply[Fix3_1]]): H[ApplyF[F1]] = f.asInstanceOf[H[ApplyF[F1]]]
- def _2[H[_]](f: H[Apply[Fix3_2]]): H[ApplyF[F2]] = f.asInstanceOf[H[ApplyF[F2]]]
- def _3[H[_]](f: H[Apply[Fix3_3]]): H[ApplyF[F3]] = f.asInstanceOf[H[ApplyF[F3]]]
- }
- private[this] val _subst = new Subst[Any, Any, Any]
- def subst[F1[_, _, _], F2[_, _, _], F3[_, _, _]]: Subst[F1, F2, F3]
- = _subst.asInstanceOf[Subst[F1, F2, F3]]
- }
Add Comment
Please, Sign In to add comment