Skip to content

Instantly share code, notes, and snippets.

View xaviervia's full-sized avatar

Fernando Via Canel xaviervia

View GitHub Profile
map => f => match([
Nil: () => Nil.of()
Cons: ([x, xs]) => Cons.of([f(x), map(f)(xs)])
})
match({
Z: Z.of,
S: match({
Z: Z.of,
S: match({
  • Principles: same (except FRP)
  • Features: should be the same
  • Core application logic:
    • No lenses
    • No selectors
    • No emphasis in actions and Symbols (no Symbols)
  • Higher-order reducers (state logic composition): out. There will be a separate paper about that
  • Effects will be renamed: "Continuation in an incremental computation graph" or something of the like. This is the meat of the paper.
    • Note: Literate programming
    • de-zazenify Cell & Graph
const computationGraph = ComputationGraph([
x => x + 1,
[
x => x * 2,
x => x / 2
],
[
x => x + 10
]
])
const three = {
type: () => [Integer],
value: 3
}
const three = {
type: () => [Integer],
value: 3
}
@xaviervia
xaviervia / README.md
Last active February 16, 2021 20:12
Sketch 43 files JSON types
@xaviervia
xaviervia / stuff.js
Created February 25, 2017 21:32
2017-02-25
Graph :
(Cell (->) a b) ->
(Cell (->) b c) ->
Either (a, Either (b, c)) ->
Either (a, Either (b, c))
Left.of(a, Left.of(b, c))
A B
Right.of([A, either(first)(first)(B)])

Iso:

  • to (orange to red turn)
  • from (red to orange turn)

Setoid:  - equals =

SemiGroup:  - concat +

window.profileSTandRAF = () => {
let end = false
let setTimeoutCount = 0
let requestAnimationFrameCount = 0
setTimeout(() => { end = true }, 2000)
const setTimeoutLoop = () => {
setTimeoutCount = setTimeoutCount + 1
if (!end) {
const initialState = {
source: `this is a text
spread (in many) lines,
- not so many though`
}
const identityParser = state => token => state
const characterNumber = parser => state => token => {
const currentCharacterNumber = state.currentCharacterNumber == null
@xaviervia
xaviervia / future.md
Created February 18, 2017 20:53
2017-02-18
  • Blockchain of blockchains with RSA public keys for resource registry (domain + intents/messages accepted)
  • Go down from HTTP/WS to have a simpler/more essential protocol for communication. Protocol not based on simple human analogies (verb, noun)
  • Protocol is (hopefully) implementation of Real OOP.
  • External resources in the language are represented with URLs
  • Discovery/caching decisions (URL resolution) is delegated to the runtime
  • Runtime should eventually be a hypervisor that only manages resource allocation. Or dedicated hardware, programs for FPGA. High level functional language for FPGA programming.
  • Language is expressed in an AST. AST can be formatted in different transport encodings (JSON for example).
  • Language is just representation of category theory operations between the resources, assuming they fulfillthe expected types.
  • Language is lazy and asynchonous by default. Tagline: "sync is just async that works very fast"
  • Under the hood, operations are Real OOP (messages)