Find it here: https://github.com/bitemyapp/learnhaskell
import java.util.List; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.HashSet; | |
import java.util.Arrays; | |
import java.util.Map; | |
import java.util.IdentityHashMap; | |
import java.util.LinkedList; | |
import java.util.SortedSet; | |
import java.util.TreeSet; |
If you're interested in making great software by discovering the deeper truth of logic and abstraction, then this is an open invitation for your participation in our community. Unfortunately, most software communities are notoriously imbalanced, creating needless hurdles for people of various gender identities, races, religions, political groups, sexual orientation, and disabled communities (to name a few). Such exclusion services no one's best interest. So, we want to actively call for participation from anyone interested in making our software better.
We guarantee a safe environment where we promote well-reasoned arguments that lead to the greatest software we can possibly make. Unfortunately, along the way someone may make an error, or worse yet, exercise malice. We'll work hard towards keeping conversations objective and inclusive. Sometimes it's tough work, but we're completely invested in the process. If you feel a public forum has not served you well, please contact us privately so we have a ch
import scalaz._, Free.Trampoline, Scalaz._ | |
sealed trait Command[T] | |
case class Wait(ms: Long) extends Command[Unit] | |
case object Evaluator extends (Command ~> Trampoline) { | |
override def apply[T](cmd: Command[T]) = cmd match { | |
case Wait(t) => Trampoline.done(Thread.sleep(t)) | |
} | |
} |
// [info] Running p.Run | |
// List(Fish(Bob, Esq.,12), Kitty(Thor, Esq.,java.awt.Color[r=255,g=200,b=0])) | |
import java.awt.Color | |
package p { | |
trait Pet[A] { | |
def name(a: A): String | |
def renamed(a: A, newName: String): A | |
} |
import scalaz._, Scalaz._ | |
// Adjunction between `F` and `G` means there is an | |
// isomorphism between `A => G[B]` and `F[A] => B`. | |
trait Adjunction[F[_],G[_]] { | |
def leftAdjunct[A, B](a: A)(f: F[A] => B): G[B] | |
def rightAdjunct[A, B](a: F[A])(f: A => G[B]): B | |
} | |
// Adjunction between free and forgetful functor. |