+ const isValidScore = score =>
+ score >= 70
+
+ const isValidUser = user =>
+ user && user.length > 3
data.reduce((acc, rec) => {
const { score, user } = rec
/* ----------------------------------------- * | |
Lazy List Implementation | |
* ----------------------------------------- */ | |
// Haskell-like infinite List, implemented with es6 generators | |
// Lazyness lets you do crazy stuff like | |
List.range(0, Infinity) | |
.drop(1000) | |
.map(n => -n) |
const { Left, Right } = require('fantasy-eithers') | |
const daggy = require('daggy') | |
Function.prototype.map = function (f) { | |
return x => f(this(x)) | |
} | |
//- Where everything changes... | |
const login = user => | |
user.name == 'Tom' |
import R from 'ramda' | |
import { account } from 'store/lenses' | |
export default { | |
ids: R.view(account.ids), | |
recentActivity: R.memoize( | |
state => R.compose( | |
ids => { | |
const hash = R.view(account.data, state) |
const Day = ({ get, left, right }) => { | |
const map = f => Day ({ | |
get: f (extract()), | |
left, right | |
}) | |
const extend = f => | |
Day ({ | |
get: (left, right) => f (Day ({ get, left, right })), |
import Maybe from 'crocks/Maybe' | |
import Star from 'crocks/Star' | |
import prop from 'crocks/Maybe/prop' | |
import propOr from 'crocks/helpers/propOr' | |
import resultToMaybe from 'crocks/Maybe/resultToMaybe' | |
import tryCatch from 'crocks/Result/tryCatch' | |
const MaybeStar = | |
Star(Maybe) |
import ReactDOM from 'react-dom' | |
import Reac, { createElement } from 'react' | |
import { compose, map, ap, pipe } from 'ramda' | |
import IntlMessageFormat from 'intl-messageformat' | |
const copyrightNotice = View(({ author, year }) => <p>© {author} {year}</p>) | |
const Monad = { | |
do: gen => { |
import curry from 'crocks/helpers/curry' | |
import or from 'crocks/logic/or' | |
import pathSatisfies from 'crocks/predicates/pathSatisfies' | |
import propSatisfies from 'crocks/predicates/propSatisfies' | |
const list = [ | |
'nice', 'bad', 'super bad' | |
] | |
const data = [ |
Flashloans are a fascinating economic coordination mechanism that has emerged out the Ethereum architecture as a result of a synchronous, sequential, atomic transaction system. It allows anonymous coordination between capital providers and arbitrageurs because the capital providers can condition providing any capital on protocol enforced guarantee that the entire arbitrage is profitable denominated in the token being lent.
One of the effects of this process has been the it ensures an efficient and healthy liquidation market for the collateral in long term debt instruments. It also enables low cost scaling of economic exploits.
Flash loans are impossible in an IBC world because IBC semantics require finalizing a block on the origin chain rather than on the receiving chain. This makes atomicity for the lender difficult and moves us into the domain of over collateralized lending.
const Either = (() => { | |
const Right = x => ({ | |
chain: f => f(x), | |
ap: other => other.map(x), | |
alt: other => Right(x), | |
extend: f => f(Right(x)), | |
concat: other => | |
other.fold( | |
x => other, | |
y => Right(x.concat(y)), |