Pour le lancer depuis vendor :
./deploy_play ../..
(defrecord Cell [x y]) | |
;; I think it can be better, might be merge with the record | |
(defn addv [cell dir] (Cell. (+ (:x cell) (first dir)) (+ (:y cell) (second dir)))) | |
(addv (Cell. 1 1) [2 2]) | |
(def initvec [(Cell. 0 0) [0 1] 1]) |
object EventDef { | |
class Event(val typee: String) | |
type State = String | |
type EventProcessor = PartialFunction[(State, Event), State] | |
type EventProcessors = Seq[EventProcessor] |
object Point extends App { | |
trait Semigroup[T] { | |
def append(p1: T, p2: T): T | |
} | |
case class Point2D(x: Int, y: Int) | |
case class Point3D(x: Int, y: Int, z: Int) | |
object Point2D { |
object Point { | |
trait PointAdder[P1, P2] { | |
def add(p1: P1, p2: P2): Point3D | |
} | |
case class Point2D(x: Int, y: Int) | |
case class Point3D(x: Int, y: Int, z: Int) | |
implicit object Point2DAdder extends PointAdder[Point2D, Point2D] { |
import shapeless._ | |
object Point extends App { | |
case class Point3D(x: Int, y: Int, z: Int) | |
case class Point2D(x: Int, y: Int) | |
case class Orange(name: String) | |
case class Apple(name: String) | |
case class Orple(name: String) |
# Last modified: 2011 May 18 | |
# Author: Florian CROUZAT <contact@floriancrouzat.net> | |
# Feel free to do whatever you want with this file. | |
# Just make sure to credit what deserve credits. | |
# Binds {{{ | |
# Prefix | |
#unbind C-b | |
#set-option -g prefix C-a | |
#bind a send-prefix |
case class MyEvent1(name:String) | |
case class MyEvent2(name:String) | |
case class Domain(t:Product) | |
object Test extends App { |
Pour le lancer depuis vendor :
./deploy_play ../..
This post inspired me : http://www.krisbuytaert.be/blog/docker-vs-reality-0-1 !
When people say real world, they actually mean the sick, bitter and desperate world they imagined for you.
So how to produce "ahoy:234" with "ahoy:" and [1,2,3] ??
The idea [1] is "a program is composed of severals one-liners", lets try to port this one liner into several popular languages. :)
-module(ale_blink). | |
-export([start/0, init/1, blink/2]). | |
init(LEDS) -> | |
application:start(gproc), | |
lists:map(fun (Port) -> gpio:start_link({Port, output}) end, LEDS). | |
blink(Port,T) -> | |
gpio:write(Port, 1), |