Skip to content

Instantly share code, notes, and snippets.

Avatar
☄️

Dan Minshew newswim

☄️
View GitHub Profile
@owickstrom
owickstrom / TodoMVC.spec.purs
Last active Sep 2, 2020
TodoMVC Showdown Specification
View TodoMVC.spec.purs
module WebCheck.PureScript.TodoMVC where
import WebCheck.DSL
import Data.Array (filter, foldMap, head, last, zip)
import Data.Foldable (length)
import Data.Int as Int
import Data.Maybe (Maybe(..), fromMaybe)
import Data.String (Pattern(..), split, trim)
import Data.Tuple (Tuple(..))
@gcanti
gcanti / GADT.ts
Last active Jul 6, 2020
Approximating GADTs in TypeScript
View GADT.ts
// Adapted from http://code.slipthrough.net/2016/08/10/approximating-gadts-in-purescript/
import { Kind, URIS } from 'fp-ts/lib/HKT'
import { URI } from 'fp-ts/lib/Identity'
import { identity } from 'fp-ts/lib/function'
// ------------------------------------------
// Leibniz
// ------------------------------------------
View Optics Cheatsheet.md
@chexxor
chexxor / purescript-lazy-load-modules-idea.md
Last active Jun 8, 2019
PureScript Lazy-load Modules Idea
View purescript-lazy-load-modules-idea.md

Lazy/Dynamic Loadable Modules in PureScript

Motivation

https://discourse.purescript.org/t/lazy-loading-routes-in-tea-style-app/141/2

Ideas

  • Here, we aren't first-class modules, because we are still using the normal module definition and import system. We believe that first-class modules refer to a special feature in OCaml.
  • Can not refer to type classes across a lazy-load boundary. Type-class instances and classes are not first-class values.
View list-applicative.md
@Kazark
Kazark / NotNotLEM.idr
Last active Nov 13, 2018
Intuitionist logic is by no means denying the law of excluded middle!
View NotNotLEM.idr
module NotNotLEM
%default total
%access public export
notDistributesOverEither : Not (Either a b) -> (Not a, Not b)
notDistributesOverEither neither = (notLeft neither, notRight neither) where
notLeft : Not (Either a b) -> Not a
notLeft neither x = neither (Left x)
@busypeoples
busypeoples / HashTrie.js
Last active Jul 16, 2018
Implementing persistent data structures with HashTries
View HashTrie.js
// @flow
// Immutable Data Implementation
// Based on Hash Tries
// (NOTE: The actual implementation is based on hashed mapped tries!)
// But this can be seen as a basis for the actual implementation.
// This is only for learning purposes!
// Hash Trie or Hash Tree is a persistent data structure, commonly used
// to implement immuable maps.
View questions-for-your-interviewer.md

I bundled these up into groups and wrote some thoughts about why I ask them!

If these helped you, I'd love to hear about it!! I'm on twitter @vcarl_ or send me an email carl.vitullo@gmail.com

Onboarding and the workplace

https://blog.vcarl.com/interview-questions-onboarding-workplace/

  • How long will it take to deploy my first change? To become productive? To understand the codebase?
  • What kind of equipment will I be provided? Will the company pay/reimburse me if I want something specific?
View 16.3-blogpost-signatures.js
class Example extends React.Component<
Props,
State,
Snapshot
> {
static getDerivedStateFromProps(
nextProps: Props,
prevState: State
): $Shape<State> | null {
// ...
View super-preliminary-elm-wasm-research.md

Super Preliminary Elm - Web Assembly Research

Back in December 2017, I started working on something I called Elmish-Wasm, which was just an experimental repo to compile something Elm-like to Wasm. I made some progress, but the helpful people I talked and I came to the conclusion that most of what I had so far (Haskell and Regex to interpret .elm files into rudimentary wasm) was something the Elm compiler and the Elm AST already did. Writing that code was a lot of fun, but maybe not the most valuable way to explore Elm and WebAssembly. Before jumping back into this project I would like to record the important facts and questions related to compiling Elm to Wasm.

What is Wasm?

A lot of people talk about Web Assembly as if its C++ that runs in the browser. Thats not the case. This belief must come from that fact that C can currently compile to web assembly. Wasm is human-unreadable bytecode. There is a human-readable version of wasm, called wat. It looks like this..

;; A function that adds two numbe
You can’t perform that action at this time.