Skip to content

Instantly share code, notes, and snippets.

View dgendill's full-sized avatar

Dominick Gendill dgendill

View GitHub Profile
@dgendill
dgendill / eventSource.png
Last active January 9, 2024 21:54
A list of halogen questions and answers
eventSource.png
@dgendill
dgendill / purescript-local-documentation.md
Last active April 16, 2017 16:04
Local Documentation In PureScript 0.10.x

Generating Local Documentation In PureScript 0.10.x

Note: It's probably easier to run a local installation of pursuit.


If pulp docs --with-dependencies or psc-docs isn't working for you, this one-liner may be helpful to generate documentation. Run the following command in your project root, and you should get a set of .md files in the docs directory along with a single index.html file (You'll need to install pandoc).

@dgendill
dgendill / fixpoint.md
Created June 22, 2017 20:49
Using Purescript Lazy Fixpoint and Lazy

Using Purescript Lazy Fixpoint and Lazy

-- Fibinachi using fixpoint and lazy
lazyFib :: Int -> Lazy Int
lazyFib x
  | x < 2 = defer \_ -> 1
  | otherwise = defer \_ -> (force $ (lazyFib (x-1))) + (force $ (lazyFib (x-2)))

fixFib :: (Int -&gt; Int)
@dgendill
dgendill / RecursionSchemesExample.purs
Created July 2, 2017 22:55
Factorial Recursion Schemes
module RecursionSchemesExample where
import Prelude
import Control.Monad.Free (Free, liftF)
import Data.Foldable (foldMap)
import Data.Functor.Nu (Nu)
import Data.List (List, catMaybes, null)
import Data.Tuple (Tuple(..))
import Matryoshka as M
-- | A dystopian phone system that punishes users who
-- | call the business when it is not open. Calls outside of
-- | business hours are put into a call queue that will never
-- | be answered.
module Main where
import Prelude
import Control.Monad.Eff (Eff)
@dgendill
dgendill / javaScriptObjectDiff.js
Created November 24, 2017 19:44
JavaScript Object Diff
// Some initial work on an object differ.
var difference = Delta(
{
a:{m:1},
c:22
},
{
a:{n:1},
b:7