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
/** | |
* Original source: | |
* [[https://gist.github.com/oxbowlakes/970717]] | |
* | |
* Modifications: | |
* - use scala 7.0.5 | |
* - use toValidationNel | |
* - use sequenceU and traverseU instead of the lambda trick | |
* | |
* Part Zero : 10:15 Saturday Night |
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
package scalaio | |
import shapeless._, poly._ | |
object list extends (Id ~> List) { | |
def apply[T](t : T) = List(t) | |
} | |
object headOption extends (List ~> Option) { | |
def apply[T](l : List[T]) = l.headOption |