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
git config --global alias.recent "for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'" |
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
// A demonstration of using scalaz.\/ (disjunctions) with flatMap and map, | |
// and how to sweeten things with for-comprehensions. | |
scala> import scalaz._ | |
import scalaz._ | |
/** Returns a disjunction based on the parity of the provided Int. | |
* @param error The message to show if the number is odd. | |
* @param number The number to test for even-ness. | |
* @return A right-disjunction containing the provided number if it's even; |
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
// | |
// Disjunction - aka Scalaz Either | |
// \/[A, B] is an alternative to Either[A, B] | |
// -\/ is Left (usually represents failure by convention) | |
// \/- is Right (usually represents success by convention) | |
// Left or Right - which side of the Disjunction does the "-" appear? | |
// | |
// Prefer infix notation to express Disjunction Type v: String \/ Double | |
// | |
// References |