|
Scala example source code file (UnapplyTest.scala)
The UnapplyTest.scala Scala example source codepackage scalaz import Leibniz.=== object UnapplyTest extends SpecLite { object unapply { val ue = Unapply[Monad, Int \/ String] def mequiv[A] = implicitly[ue.M[A] === (Int \/ A)] implicitly[ue.A === String] // needs only transient stable type Unapply[Monad, Int \/ String].TC : Monad[Int \/ ?] } object unapply2 { val ue = Unapply2[Arrow, Kleisli[NonEmptyList, Int, String]] def mequiv[A,B] = implicitly[ue.M[A,B] === Kleisli[NonEmptyList, A, B]] implicitly[ue.A === Int] implicitly[ue.B === String] // needs only transient stable type Unapply2[Arrow, Kleisli[NonEmptyList, Int, String]].TC: Arrow[Kleisli[NonEmptyList, ?, ?]] } object unapplyProduct { val ue = UnapplyProduct[Applicative, Writer[IList[String], Int], Writer[IList[String], Char]] def mequiv[A] = implicitly[ue.M[A] === Writer[IList[String], A]] implicitly[ue.A === Int] implicitly[ue.B === Char] // needs only transient stable type UnapplyProduct[Applicative, Writer[IList[String], Int], Writer[IList[String], Char]].TC: Applicative[Writer[IList[String], ?]] } } Other Scala examples (source code examples)Here is a short list of links related to this Scala UnapplyTest.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.