Update 29/02/2016
The call is now closed. Thanks to eveyone that submitted
This is a lightweight call for speakers for "Almost Functional", a one-off, free, evening event in Edinburgh on the 14th of April.
Please spread this URL far and wide.
/** | |
* Based on | |
* https://github.com/donnut/typescript-ramda | |
* with the help of the typescript-converter from | |
* [email protected]:ptmt/flow-declarations.git | |
*/ | |
declare module 'ramda' { | |
declare type placeholder = {} | |
declare type ListIterator<T, TResult> = { | |
(value: T, index: number, list: T[]): TResult; |
const daggy = require('daggy'); | |
const {foldMap} = require('pointfree-fantasy') | |
const {concat, toUpper, prop, identity, range, compose} = require('ramda'); | |
// Contravariant functors usually have this shape F(a -> ConcreteType). | |
// In other words, some type holding a function which is parametric on its input, but not output. | |
// They don't always have that shape, but it's a good intuition | |
// Covariant functors are what we're used to, which are parametric in their output | |
//================================================================ |
const I = x => x | |
const K = x => y => x | |
const A = f => x => f (x) | |
const T = x => f => f (x) | |
const W = f => x => f (x) (x) | |
const C = f => y => x => f (x) (y) | |
const B = f => g => x => f (g (x)) | |
const S = f => g => x => f (x) (g (x)) | |
const S_ = f => g => x => f (g (x)) (x) | |
const S2 = f => g => h => x => f (g (x)) (h (x)) |
Update 29/02/2016
The call is now closed. Thanks to eveyone that submitted
This is a lightweight call for speakers for "Almost Functional", a one-off, free, evening event in Edinburgh on the 14th of April.
Please spread this URL far and wide.
20:10 dat-gitter-bot> (scriptjs) @mafintosh can you contrast hyperlog vs hypercore for their log capabilities, you dropped hypercore at some point. Is hypercore by itself as useful for an append only log use case? | |
20:10 <•mafintosh> @scriptjs right | |
20:10 <•mafintosh> so hyperlog is a DAG structure (a merkle dag even) | |
20:10 <•mafintosh> where data you insert can point to other data you insert | |
20:10 <•mafintosh> which is really great if you have multiple peers collaborating on the same data structure | |
20:11 <•mafintosh> a hyperlog is also always fully replicated since that makes the replication protocol pretty trivial | |
20:11 <•mafintosh> (i really need to write some white paper on that at some point) | |
20:11 <•mafintosh> hypercore is just simple single-writer append-only logs | |
20:11 <•mafintosh> so abstraction-wise hyperlog > hypercore | |
20:12 <•mafintosh> we could even make hyperlog run on top of hypercore which i really wanna do |
class Future { | |
constructor(computation) { | |
this.fork = computation | |
this.__future__ = true; | |
} | |
static is(val) { | |
return (val != null && val.__future__ === true) | |
} | |
static of(value) { | |
if (Future.is(value)) return value; |
In Haskell we can define Monoid instances like this:
instance Monoid b => Monoid (Identity b) where
mempty = mempty
mappend (Identity a) (Identity b) = Identity (a `mappend` b)
instance (Monoid a, Monoid b) => Monoid (Pair a b) where