module M1
module M2
module M3
module M4
module M5
def foo; end
a = 1
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 ffutures | |
import scala.concurrent._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.duration._ | |
import scala.language.postfixOps | |
object FFutures { |
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
// No need to define an HList trait | |
case class #::[A, B](head: A, tail: B) { | |
def #::[S](e: S): S #:: A #:: B = new #::(e, this) | |
override def toString = s"$head #:: $tail" | |
} | |
trait HNil | |
case object HNil extends HNil { | |
def #::[S](e: S): S #:: HNil = new #::(e, HNil) | |
override def toString = "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
define(function (require, exports, module) { | |
'use strict'; | |
var Extensions = require('ft/core/extensions').Extensions; | |
function updateTree(tree, fn) { | |
try { | |
tree.beginUpdates(); | |
fn(); | |
} finally { |
I hereby claim:
- I am dohzya on github.
- I am dohzya (https://keybase.io/dohzya) on keybase.
- I have a public key whose fingerprint is 7BE4 EB58 913B A60A 0BDC 7DA8 189A FB68 1243 CC07
To claim this, I am signing this object:
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
type Store[A, B] = (A => B) => B | |
def store[A, B](a: A): Store[A, B] = (x: A => B) => x(a) | |
// This version does not compile (returns A instead of B): | |
// def get[A, B](s: F[A, B]) = s(identity) | |
// There is a version which works, but which is kind of useless: | |
def get[A](s: Store[A, A]) = s(identity) | |
// This version does not compile (returns Int instead of 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
package main | |
import ( | |
"http" | |
"io" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
io.Copy(w, r.Body) |
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
// avoid warnings about the use of Higher Kinds | |
import scala.language.higherKinds | |
// implementing Forall | |
trait Forall[+G[_]] { def apply[A]: G[A] } | |
// note: this implementation is covariant, in order to make Null works | |
// The Cons type, based on Forall | |
type Cons[+A, +B] = Forall[({ type G[C] = ((A, B) => C) => C })#G] | |
def cons[A, B](a: A, b: B): Cons[A, B] = new Cons[A, B] { |
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
# You can pass any object implementing the same methods as the BasicCache | |
# https://github.com/prismicio/ruby-kit/blob/master/lib/prismic/cache/basic.rb | |
cache = Prismic::BasicCache.new | |
api = Prismic::api('https://lesbonneschoses.prismic.io/api', cache: cache) | |
# The Api will use the custom cache object |
I just can't explain what I think in 140 chars, so here is a longer text.
Note that my goal is not to say “I'm right” but to be sure we understand each other. (hey, if I'm right it's good for my ego, but if I'm not it's even better for my intellect).
So please tell me if you don't agree ;-)
OlderNewer