Skip to content

Instantly share code, notes, and snippets.

@ericluria
ericluria / git-recent.txt
Created May 25, 2018 19:13
Set a global alias to view recent branches with `git recent`
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))'"
// 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;
//
// 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