("a" + "b") + "c"= "a" + "b" + "c"= "a" + ("b" + "c")λfλgλx.(f (g x))var compose = function(f, g) {
return function(x) {
return f(g(x));
};
};https://github.com/CraigStuntz/TinyLanguage
module Compiler
let compile =
Lexer.lex
>> Parser.parse
>> Binder.bind
>> OptimizeBinding.optimize
>> IlGenerator.codegen
>> Railway.map OptimizeIl.optimize
>> Railway.map Il.toAssemblyBuildertype ParseResult =
| Success of Token * string
| Failure of Errorfirst : (A, B) -> A
first (a, b) = a
second : (A, B) -> B
second (a, b) = bdata AorB =
OnlyA A
| OnlyB B
map : Functor f => (a -> b) -> f a -> f b
safeLength : Maybe String -> Maybe Int
safeLength maybeStr = map length maybeStr
render : Signal UIState -> Signal HTML
render signal = Signal.map stateToHtml signalList v = new ArrayList();
v.add("test");
Integer i = (Integer)v.get(0);List<String> v = new ArrayList<>();
v.add("test");
Integer i = v.get(0);https://en.wikipedia.org/wiki/Generics_in_Java
State -> Event -> (State, Event)State -> Request -> (State, Response)State -> Projectionhttps://bartoszmilewski.com/2014/10/28 /category-theory-for-programmers-the-preface/