This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "reader-intro", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"build": "tsc", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f (str: string) { | |
return str + "!" | |
} | |
function* g(str: string) { | |
yield str.length > 0 | |
return str + "!" | |
} | |
function* h(str: string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as fs from 'fs' | |
const contents = fs.readFileSync('input', 'utf8') | |
const valuesReact = (x: string) => (y: string) => { | |
const del = Math.abs((x.charCodeAt(0) - y.charCodeAt(0))) | |
return del === 32 | |
} | |
const fin = contents.split('').reduce((acc, curr) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const $ = require('sanctuary-def') | |
const { create, env } = require('sanctuary') | |
const def = $.create({ | |
checkTypes: true, | |
env: $.env | |
}) | |
const MyBool = $.NullaryType | |
('dokidoki-types/MyBool') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const $ = require('sanctuary-def') | |
const { create, env } = require('sanctuary') | |
const def = $.create({ | |
checkTypes: true, | |
env: $.env | |
}) | |
const FirstType = $.NullaryType | |
('dokidoki-types/FirstType') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as readerT from "fp-ts/lib/ReaderT" | |
import { future } from "fp-ts-fluture/lib/Future" | |
import { of, reject, FutureInstance as Future } from "fluture" | |
import { identity } from "fp-ts/lib/function"; | |
type Env = { | |
locale: string | |
} | |
const env$: Env = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const $ = require('sanctuary-def') | |
const def = $.create({ | |
checkTypes: true, | |
env: $.env | |
}) | |
const bangBang = | |
def ('bangBang') | |
({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const S = require('sanctuary') | |
const $ = require('sanctuary-def') | |
const x = 42 | |
const s = "butter" | |
// this will work | |
const oops = x + s | |
// this will blow up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
import * as R from 'ramda' | |
import * as Future from 'fluture' | |
import { Promise } from 'es6-promise' | |
import { AxiosResponse, AxiosError } from "axios"; | |
interface Post { | |
id: number; | |
userId?: number; | |
title: string; |