Created
November 14, 2017 22:24
-
-
Save fommil/0b5f73dc9b3821cbc9b5fb1201f077c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright: 2017 Sam Halliday | |
// License: http://www.gnu.org/licenses/gpl.html | |
package scalaz | |
import scala.Option | |
import Scalaz._ | |
sealed abstract class /~\[F[_], C[_]] { | |
type T | |
def value: C[T] | |
def tc: F[T] | |
} | |
object /~\ { | |
type Aux[F[_], C[_], A] = /~\[F, C] { type T = A } | |
def unapply[F[_], C[_]](p: F /~\ C): Option[(F[p.T], C[p.T])] = | |
scala.Predef.??? | |
def apply[F[_], A](a: A, fa: => F[A]): Aux[F, Id, A] = new /~\[F, Id] { | |
type T = A | |
def value: A = a | |
def tc: F[A] = fa | |
} | |
type T2[A] = (A, A) | |
def apply[F[_], A](a1: A, a2: A, fa: => F[A]): Aux[F, T2, A] = | |
new /~\[F, T2] { | |
type T = A | |
def value: (A, A) = (a1, a2) | |
def tc: F[A] = fa | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment