((\f.\g.\x.f(gx))(\f.\x.\y.fyx)(\f.\x.\y.fyx))(\x.x)
Renaming things for clarity...
((\f.\g.\x.f(gx))(\f2.\x2.\y2.f2 y2 x2)(\f3.\x3.\y3.f3 y3 x3))(\x4.x4)
const Promise = require('fantasy-promises') | |
const daggy = require('daggy') | |
//- Regular `compose` - old news! | |
//+ compose :: (b -> c) | |
//+ -> (a -> b) | |
//+ -> a -> c | |
const compose = f => g => x => | |
f(g(x)) |
const daggy = require('daggy') | |
const { uncurryN } = require('wi-jit') | |
Array.prototype.empty = () => [] | |
Sum = daggy.tagged('value') | |
Sum.prototype.concat = function (that) { | |
return Sum(this.value + that.value) | |
} |
const { tagged } = require('daggy') | |
const Pair = tagged('_1', '_2') | |
//+ data Store p s = Store (p -> s) p | |
const Store = tagged('lookup', 'pointer') | |
Array.prototype.equals = function (that) { | |
return this.length === that.length | |
&& this.every((x, i) => x.equals ? x.equals(that[i]) |
module Main where | |
import Prelude | |
import Control.Apply (lift2) | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, log) | |
import Data.Maybe (Maybe(Just, Nothing)) | |
import Data.Tuple (Tuple(Tuple)) | |
import FRP (FRP) |
module Main where | |
import Prelude | |
import Control.Comonad (class Comonad, class Extend, extend, extract) | |
import Control.Monad.Eff.Console (log) | |
import Data.Array ((..), (!!), cons, length, replicate, zipWith) | |
import Data.Function (on) | |
import Data.Int (fromStringAs, binary, toNumber, floor) | |
import Data.Int.Bits ((.&.)) |
((\f.\g.\x.f(gx))(\f.\x.\y.fyx)(\f.\x.\y.fyx))(\x.x)
Renaming things for clarity...
((\f.\g.\x.f(gx))(\f2.\x2.\y2.f2 y2 x2)(\f3.\x3.\y3.f3 y3 x3))(\x4.x4)
module Main where | |
import Prelude (Unit, ($), discard) | |
import Type.Prelude | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, logShow) | |
import Data.Record (get) | |
import Data.Tuple (Tuple) | |
import Data.Tuple.Nested ((/\)) |
module Main where | |
-- Often in applications, we want to generate unique IDs. In imperative | |
-- programming, we might be tempted to define, albeit with obfuscation, | |
-- a global integer that we increment every time we want a new value. | |
-- In this gist, we'll look at how to achieve the same thing using the | |
-- state type to keep things good and pure. | |
import Control.Apply (lift2) | |
import Control.Monad.Eff (Eff) |
-- Folding | |
project :: Nat -> Maybe Nat | |
cata :: (Maybe a -> a) -> Nat -> a | |
gcata :: Comonad w => Distributive w => (Maybe (w a) -> a) -> Nat -> a | |
para :: (Maybe (Nat, a) -> a) -> Nat -> a | |
gpara :: Comonad w => Distributive w => (Maybe (Nat, w a) -> a) -> Nat -> a |
"For services to the PureScript Community, Gary Burgess!"
You've done it, Gary. Moore, Lineker, Coleman, and now Burgess. All the work was worth it.
The halls erupted with praise. Children dressed as Space Ghost, teens with "I only get high on
Halogen
" t-shirts, a giant banner held aloft with the message, "Tuple @garyb me
". Through
the noise of the crowds and Phil's uninterpretable Northern accent, he barely managed to hear
his theme tu-
BZZP. BZZP.