fantasyland/fantasy-land — pull request #66 by phadej (2014-04-15 12:35:01+00:00)
Title: Make package export fantasy-fill

Related to https://github.com/fantasyland/fantasy-land/issues/24 https://github.com/fantasyland/fantasy-land/issues/56

With the fantasy fill you can fill the gaps in your pure functional, monadic fantasies.

```js
var Id = require('./id.js');
var fantasyFill = require('./index.js');

function MyId(x) {
this.value = x;
}

MyId.of = function (value) {
return new MyId(value);
};

MyId.prototype.chain = function (action) {
return action(this.value);
};

console.log('Id: ', fantasyFill(Id).join(", "));
console.log('MyId: ', fantasyFill(MyId).join(", "));

console.log('MyId 3 `map` \\x -> x * x: ', MyId.of(3).map(function (x) { return x * x; }));
```

```
Id: Applicative, Apply, Chain, Functor, Monad, Monoid, Semigroup
MyId: Applicative, Apply, Chain, Functor, Monad
MyId 3 `map` \x -> x * x: { value: 9 }
```