Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom therewillbecode

View GitHub Profile
View Optics Cheatsheet.md
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active Sep 18, 2021
React lifecycle cheatsheet
View react-lifecycle-cheatsheet.md

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
View rxjs_operators_by_example.md
View SystemF.agda
module SystemF where
open import Agda.Primitive
open import Prelude
open import Data.List
weaken-∈ : {a : Set} (Γ₁ : List a) {Γ x y} x ∈ (Γ₁ ++ Γ) x ∈ (Γ₁ ++ y ∷ Γ)
weaken-∈ [] (zero refl) = suc (zero refl)
weaken-∈ [] (suc i) = suc (suc i)
weaken-∈ (x ∷ Γ₁) (zero p) = zero p
View STLC.agda
module STLC where
open import Prelude
open import Data.List
infixr 7 _=>_
data Type : Set where
nat : Type
_=>_ : (a b : Type) Type
@sdiehl
sdiehl / state.hs
Created Jan 13, 2015
State monad implementation + example
View state.hs
import Control.Monad
-------------------------------------------------------------------------------
-- State Monad Implementation
-------------------------------------------------------------------------------
newtype State s a = State { runState :: s -> (a,s) }
instance Monad (State s) where
return a = State $ \s -> (a, s)
@mikehaertl
mikehaertl / gist:3258427
Created Aug 4, 2012
Learn you a Haskell - In a nutshell
View gist:3258427

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.