This is a port of the RemoteData type from Kris Jenkins article „How Elm Slays a UI Antipattern“ to TypeScript with TsMonad. There have been ports to Flow and JavaScript as well.
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
This is a curated list of iOS (Swift & ObjC) frameworks which are inspired by React and Elm.
- ReactSwift by @ColinEberhardt
- https://github.com/ColinEberhardt/ReactSwift
-
JavaScript: Hand-written JavaScript.
-
Idris-codegen-es: Idris 1.0 with idris-codegen-es.
-
Idris (Official JS): Idris 1.0 with official JavaScript Codegen.
-
PureScript: Using Latest PureScript.
-
PureScript (Uncurried): Latest PureScript with
Data.Function.Uncurry. -
Idris (C): Idris 1.0 with C codegen on Windows x64.
-
C: Hand-written JavaScript, compiled with gcc 6.2.0, with Win64 settings and
-O3.
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
type StringBool = "true"|"false";
interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };
type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];| ;; Fira code | |
| (set-default-font "Fira Code") | |
| (let ((alist '((33 . ".\\(?:\\(?:==\\|!!\\)\\|[!=]\\)") | |
| (35 . ".\\(?:###\\|##\\|_(\\|[#(?[_{]\\)") | |
| (36 . ".\\(?:>\\)") | |
| (37 . ".\\(?:\\(?:%%\\)\\|%\\)") | |
| (38 . ".\\(?:\\(?:&&\\)\\|&\\)") | |
| (42 . ".\\(?:\\(?:\\*\\*/\\)\\|\\(?:\\*[*/]\\)\\|[*/>]\\)") | |
| (43 . ".\\(?:\\(?:\\+\\+\\)\\|[+>]\\)") | |
| (45 . ".\\(?:\\(?:-[>-]\\|<<\\|>>\\)\\|[<>}~-]\\)") |
| 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) |
`` |
| import React from 'react' | |
| import { render } from 'react-dom'; | |
| import { Router, Route } from 'react-router-dom'; | |
| import LazyRoute from 'lazy-route'; | |
| const App = () => { | |
| render() { | |
| return ( | |
| <Router> | |
| <Route |