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 pl.irc | |
import org.jibble.pircbot.PircBot | |
import dispatch._ | |
import Http._ | |
import net.liftweb.json._ | |
import net.liftweb.json.JsonDSL._ | |
import net.liftweb.json.Printer.{compact} | |
object Multibottest extends PircBot { |
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
F[A] // A is a Functor | |
M[A] // A is a Monad | |
fa: F[A], a: A // variables used below | |
fa1 |+| fa2 // binary append (SemiGroup) | |
fa1 >| fa2 // map (Functor) | |
fa1 >>= fa2 // flatmap (Bind) | |
fa1 |>| fa2 // foreach (Each) | |
fa <**> fb { (a, b) => c } // apply, produces F[C] |
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
trait Functor[F[_]] { | |
def fmap[A, B](f: A => B): F[A] => F[B] | |
} | |
trait Extend[F[_]] extends Functor[F] { | |
// coflatmap | |
def extend[A, B](f: F[A] => B): F[A] => F[B] | |
} | |
trait Comonad[F[_]] extends Extend[F] { |
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
module Examples where | |
import Control.Applicative | |
import Control.Monad.Trans | |
import Data.Machine | |
data Bit = EMPTY | One | Zero | |
instance Show Bit where |
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 chavrusa.ivr | |
import Trampoline.{ Done => TDone, More => TMore, Cont => TCont } | |
trait Iteratees[Err] { | |
sealed trait Input[+I] | |
case class El[+I](value: I) extends Input[I] | |
case object Empty extends Input[Nothing] | |
case object EOF extends Input[Nothing] |
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
Inductive bool : Type := | |
| true : bool | |
| false : bool. | |
Class Monoid (A : Type) := | |
{ | |
empty : A ; | |
append : A -> A -> A ; | |
left_neutrality : forall x, append empty x = x ; |