In this tutorial we're going to build a set of parser combinators.
We'll answer the above question in 2 steps.
- What is a parser?
- and, what is a parser combinator?
So first question: What is parser?
import { fetchQuery, graphql } from 'relay-runtine'; | |
export const fetchVersion = async (environment) => { | |
const response = fetchQuery( | |
environment, | |
graphql` | |
query fetchVersionQuery { | |
version | |
} | |
`, |
A list of links containing cool references, resources and things related to books about Computer Science and related.
import ts from 'typescript'; | |
import { readFile, writeFile } from 'fs/promises'; | |
const sourceText = await readFile('./input.ts', { encoding: 'utf8' }); | |
const source = ts.createSourceFile('input.ts', sourceText, ts.ScriptTarget.Latest); | |
const newArticle = ts.factory.createObjectLiteralExpression( | |
[ | |
ts.factory.createPropertyAssignment( |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- OPML generated by NetNewsWire --> | |
<opml version="1.1"> | |
<head> | |
<title>rss.opml</title> | |
</head> | |
<body> | |
<outline text="@jimmyislive" title="@jimmyislive" description="" type="rss" version="RSS" htmlUrl="https://jimmyislive.dev/" xmlUrl="https://jimmyislive.dev/index.xml"/> | |
<outline text="2ality – JavaScript and more" title="2ality – JavaScript and more" description="" type="rss" version="RSS" htmlUrl="" xmlUrl="https://feeds.feedburner.com/2ality"/> | |
<outline text="AAAS: Keyword search for query" title="AAAS: Keyword search for query" description="" type="rss" version="RSS" htmlUrl="https://www.science.org/" xmlUrl="https://www.science.org/blogs/pipeline/feed"/> |
import Paper from '@mui/material/Paper'; | |
import Table from '@mui/material/Table'; | |
import TableBody from '@mui/material/TableBody'; | |
import TableCell from '@mui/material/TableCell'; | |
import TableContainer from '@mui/material/TableContainer'; | |
import TableHead from '@mui/material/TableHead'; | |
import TableRow from '@mui/material/TableRow'; | |
import { | |
useReactTable, | |
getCoreRowModel, |
const TRUE = x => y => x; | |
const FALSE = x => y => y; | |
const zero = f => x => x; | |
const succ = n => f => x => f(n(f)(x)); | |
const plus = m => n => f => x => m(f)(n(f)(x)); | |
const mult = m => n => f => x => m(n(f))(x); | |
const exp = m => n => n(m); | |
const pred = n => f => x => n(g => h => h(g(f)))(u => x)(u => u); |
#["LÓGICA DE PROGRAMAÇÃO" É BOBAGEM, e explicarei porquê.]
Se preparem que o texto é longo.
Várias vezes chegam novatos aqui perguntando como começar, e a galera diz "estuda lógica primeiro, depois vai pra linguagem X". Vivo dizendo que é bobagem. Ontem, em particular, falei isso, e vieram várias pessoas por inbox me perguntar porquê (e uma pra me xingar, achando que falei por arrogância).
Pra facilitar, eu vou escrever uma boa explicação de porquê "lógica de programação" é furada, doa a quem doer, e postar na APDA e no fórum da EnergyLabs (para futuras referências, porque esse assunto vai voltar, ctz).