(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
After listening to the latest Magic Read-along episode "You should watch this" (which you should go listen to now) I got
caught up thinking about Brian's idea of an Endomorphism version of Kleisli composition for use with Redux,
it's actually a very similar model to what I'm using in my event
framework for event listeners so I figured I'd try to formalize the pattern and recognize
some of the concepts involved. IIRC Brian
described the idea of a Redux-reducer, which is usually of type s -> Action -> s
, it takes a state and an action and returns
a new state. He then re-arranged
the arguments to Action -> s -> s
. He then recognized this as Action -> Endo s
(an Endo
-morphism is just any function
from one type to itself: a -> a
).
He would take his list of reducers and partially apply them with the Action
, yielding a list of type Endo s
where s
First and foremost a coding screencast is about the code, and we need to make sure it looks great. There are a few aspects to this that help ensure that is the case.
720p is the target resolution. In pixel terms this is 1280x720. We've gotten the best results when we record at 2560x1440 in a HiDPI (pixel double) mode, giving an effective visible resolution of 1280x720, but extremely crisp. This resolution is achievable on 27" monitors and retina MBPs.
An introduction to functional thinking with examples in JavaScript.
https://medium.com/@chetcorcos/functional-programming-for-javascript-people-1915d8775504#.p0hyzlyjq
A soft, informal introduction to the Fantasy Land spec.
https://james-forbes.com/?/posts/the-perfect-api
Douglas Crockford, author of JavaScript: The Good parts, recently gave a talk called The Better Parts, where he demonstrates how he creates objects in JavaScript nowadays. He doesn't call his approach anything, but I will refer to it as Crockford Classless.
Crockford Classless is completely free of class, new, this, prototype and even Crockfords own invention Object.create.
I think it's really, really sleek, and this is what it looks like:
function dog(spec) {
Ramda | Sanctuary |
---|---|
add(a, b) |
add(b, a) |
addIndex(f) |
`` |
adjust(f, i, xs) |
`` |
all(f, xs) |
`` |
allPass(fs, x) |
allPass(fs, x) |
always(x) |
K(x) |
and(a, b) |
and(a, b) |
any(f, x) |
`` |
create-react-native-app purescript-app; cd purescript-app
pulp init --force
pulp build
src/Main.js
var React = require("react");
var RN = require("react-native");
exports.text = function(props){
use std::rc::Rc; | |
trait HKT<U> { | |
type C; // Current type | |
type T; // Type with C swapped with U | |
} | |
macro_rules! derive_hkt { | |
($t:ident) => { | |
impl<T, U> HKT<U> for $t<T> { |
#!/usr/bin/env stack | |
-- stack --resolver lts-10.8 --install-ghc exec ghci | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE LambdaCase #-} | |
-- A key type for pretend use in looking up a doggo in a database. | |
newtype Key a = Key { unKey :: String } |