Skip to content

Instantly share code, notes, and snippets.

@tpolecat
Last active December 26, 2015 22:19
Show Gist options
  • Save tpolecat/7222604 to your computer and use it in GitHub Desktop.
Save tpolecat/7222604 to your computer and use it in GitHub Desktop.
// 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