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
import scalaz.Applicative | |
import scalaz.concurrent.Task | |
/** | |
* This `Applicative[Task]` runs tasks in parallel, by defining | |
* `ap` and `apply2` in terms of `mapBoth`. This differs from the | |
* default `Applicative[Task]`, where effects are sequenced | |
* deterministically, in left to right order. | |
*/ | |
val T = new Applicative[Task] { |
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
scala> import SingletonTypes._ ; import Record._ | |
import SingletonTypes._ | |
import Record._ | |
scala> val r = "name" ->> "foo" :: "age" ->> 1 :: "lastName" ->> "bar" :: HNil | |
r: shapeless.::[String with Object{type keyType = String("name")},shapeless.::[Int with Object{type keyType = String("age")},shapeless.::[String with Object{type keyType = String("lastName")},shapeless.HNil]]] = foo :: 1 :: bar :: HNil | |
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
/** | |
* Digging through arbitrarily nested case classes, tuples, and lists | |
* by Travis Brown | |
* | |
* In response to this question by Channing Walton on the Shapeless dev list: | |
* | |
* https://groups.google.com/d/msg/shapeless-dev/hn7_U21tupI/Zm9h3uNb51gJ | |
* | |
* Tested with Scala 2.9.2 and Shapeless 1.2.3. Should work on 1.2.2 with minor edits. | |
*/ |