Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / gist:5558557
Last active April 18, 2024 14:32
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

@ekmett
ekmett / Pro.hs
Created June 7, 2014 10:53
towards generalized profunctor lenses
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE PolyKinds #-}
@sjoerdvisscher
sjoerdvisscher / Pro.hs
Last active May 23, 2018 21:16 — forked from ekmett/Pro.hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE PolyKinds #-}
@saurabhnanda
saurabhnanda / extending-opaleye.md
Last active November 26, 2017 09:43
Extending Opaleye

Context

As a user of Opaleye, I feel that Opalaye's public API is missing a number of features/niceties that are required by most people using the library in a largish project. The number of separate projects trying to close these gaps seem to strengthen this point:

Based on the discussion at silkapp/girella#9, specifically Tom's approval in that thread, this is an effort to build consensus around features that Opaleye's users would like to see in the core library directly. Of course, these features should not compromise general principles that @tomjaguarpaw has specifically mentioned:

@justinwoo
justinwoo / purescript-reactive-programming-notes.md
Last active March 30, 2021 14:01
Purescript Reactive Programming options

Here are some of the examples of Reactive Programming libraries I've found in Purescript and what I've thought about them so far:

I've never used a library with truly continuous Behaviors, so this was really neat to try out for me. Really nice to use and comes with utilities for working with browser events already, and gives you good Event modules for picking your sampling options as necessary.

I will probably use this library for all of my future uses.

How to upgrade to Purescript 0.12

Before we begin, the type search in Pursuit is a great way to search for the functions you need.

Reset your tooling by deleting the bower_components/, .psci_modules/, .pulp-cache/, .psc-package/ and output/ folders. Then run psc-package build --only-dependencies.

Import changes and effects

Using sed or your other favourite global replace tool to search and replace all occurences in the list

@chrisdone
chrisdone / 0README.md
Last active February 6, 2019 11:09
Onto syntax for exhaustive construction of a data type

Motivation

For an ADT type, such as,

data Exp = Num Int | App Char Exp
  deriving (Show)

In Haskell we have case expressions to deconstruct values, and they have exhaustiveness checking. We have

-- specular
-- Specular.FRP.Base
nextTimeRef :: Ref Time
readBehavior :: forall a. Behavior a -> Pull a
newtype Event a = Event
{ occurence :: Behavior (Maybe a)
, subscribe :: Listener -> Effect Unsubscribe
}
newtype Dynamic a = Dynamic