update
I've created a little repository that simply exposes the final utility as npm
module.
It's called html-escaper
there is basically one rule only: do not ever replace one char after another if you are transforming a string into another.
update
I've created a little repository that simply exposes the final utility as npm
module.
It's called html-escaper
there is basically one rule only: do not ever replace one char after another if you are transforming a string into another.
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
module type Functor = sig | |
type 'a t | |
val map : ('a -> 'b) -> ('a t -> 'b t) | |
end | |
module Iso = struct | |
type ('a, 'b) t = { fwd : 'a -> 'b; bck : 'b -> 'a } | |
let fwd i = i.fwd | |
let bck i = i.bck |
import _ from 'lodash' | |
function ooify(fn) { | |
return function() { | |
return fn.apply(this, [this].concat([].slice.call(arguments))) | |
} | |
} | |
var methods = _.zipObject(_.map(_.keys(_.prototype), methodName => { | |
return [methodName, ooify(_[methodName])] | |
})) |
// please comment if you know of other BOOKS (not considering blogs just yet) on ES6 that are out or coming out
babel github-es6.js -o github.js --optional runtime --experimental |
{-# LANGUAGE ExistentialQuantification #-} | |
import Control.Applicative | |
import Data.Functor.Identity | |
data Ap f a = Pure a | |
| forall x y. LiftA2 (x -> y -> a) (f x) (Ap f y) | |
instance Functor f => Functor (Ap f) where | |
fmap f (Pure a) = Pure (f a) |
Liquid Fill Gauge v1.1 - 7/14/2015
Changes:
Configurable features include:
{-# LANGUAGE RankNTypes #-} | |
data Proc a = Action1 a | Action2 a | Action3 a | |
newtype Yoneda f a = Yoneda { runYoneda :: forall b. ((a -> b) -> f b) } | |
instance Functor (Yoneda f) where | |
fmap f m = Yoneda (\k -> runYoneda m (k . f)) | |
data Free f a = Pure a | Free (f (Free f a)) |