-
https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/
This means no running stack install ghc-mod or stack install intero either, no matter what READMEs might tell you!
This file contains hidden or 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 hasKey<T extends object, K extends string>(x: T, key: K): x is T & { [_ in K]: unknown } { | |
| return key in x; | |
| } | |
| type TypeOfs = { | |
| string: string; | |
| number: number; | |
| object: object; | |
| }; |
This file contains hidden or 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 t from "io-ts"; | |
| import { record } from "fp-ts/lib/Record"; | |
| const handler = <I, A, R>(decoder: t.Decoder<I, A>, f: (_: A) => R) => ({ | |
| decoder, | |
| f, | |
| }); | |
| type Handler = ReturnType<typeof handler>; |
This file contains hidden or 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
| type Fluent<T extends object> = { | |
| [K in keyof T]: (() => void) extends T[K] | |
| ? T[K] extends (...args: infer Params) => void | |
| ? (...args: Params) => Fluent<T> | |
| : T[K] | |
| : T[K]; | |
| }; | |
| /** |
This file contains hidden or 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 exhaustive(x: never): never { | |
| throw new Error(` | |
| Unreachable default case. | |
| ${x} is not assignable to type never. | |
| `) | |
| } | |
| type Fruit = "apple" | "banana" | "mango"; | |
| declare const fruit: Fruit; |
This file contains hidden or 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
| // https://svelte.dev/repl/65dc3ff369ea423f918e7ac3425b5677?version=3.6.9 | |
| <script> | |
| const pipe = (x, ...fs) => fs.reduce((v, f) => f(v), x); | |
| const zip = xs => ys => xs.map((x, i) => [x, ys[i]]); | |
| const head = xs => xs[0]; | |
| const filter = predicate => xs => xs.filter(predicate); | |
| const map = predicate => xs => xs.map(predicate); | |
| const tap = proc => x => { | |
| proc(x); |
This file contains hidden or 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
| namespace Products { | |
| export type Car = { | |
| name: 'Car'; | |
| drive(): void; | |
| } | |
| export type IceCream = { | |
| name: 'IceCream'; | |
| flavor: string; | |
| } |
This file contains hidden or 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 questions = [ | |
| { | |
| message: 'Enter your login (email address)...', | |
| name: 'login', | |
| type: 'input', | |
| }, | |
| { | |
| message: 'Enter your password...', | |
| name: 'password', | |
| type: 'password', |
- https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
- https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens
- https://marketplace.visualstudio.com/items?itemName=2gua.rainbow-brackets ( or https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer )
- https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
- https://marketplace.visualstudio.com/items?itemName=jpoissonnier.vscode-styled-components
Vue: