Last active
December 26, 2015 22:19
-
-
Save tpolecat/7222604 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Where the hell does B come from? Looks like a type variable is escaping. | |
scala> Left(1).disjunction | |
res14: scalaz.\/[Int,B] = -\/(1) | |
// It's not Nothing | |
scala> Left(1).disjunction : (Int \/ Nothing) | |
<console>:17: error: type mismatch; | |
found : scalaz.\/[Int,B] | |
required: scalaz.\/[Int,Nothing] | |
Left(1).disjunction : (Int \/ Nothing) | |
^ | |
// If we get the syntax explicitly it infers Nothing, as expected | |
scala> ToEitherOpsFromEither(Left(1)).disjunction | |
res0: scalaz.\/[Int,Nothing] = -\/(1) | |
// Also, um | |
scala> reflect.runtime.universe.reify { Left(1).disjunction } | |
<console>:17: error: macro has not been expanded | |
reflect.runtime.universe.reify { Left(1).disjunction } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment