Skip to content

Instantly share code, notes, and snippets.

Tim Pierson o1lo01ol1o

  • bklyn
View GitHub Profile
@o1lo01ol1o
o1lo01ol1o / .spacemacs
Created Dec 6, 2018
current-spacemacs
View .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@o1lo01ol1o
o1lo01ol1o / Readme.md
Last active Nov 7, 2018
Axiom and Reflex project skeleton
@o1lo01ol1o
o1lo01ol1o / .spacemacs
Last active Oct 31, 2018
nixos CI pipes
View .spacemacs
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
@o1lo01ol1o
o1lo01ol1o / configuration.nix
Created Oct 11, 2018
simple-hydra with hydra-master
View configuration.nix
{ config, pkgs, lib, ...}:
{
services.hydra.package = pkgs.hydra.overrideAttrs (o: { src = (pkgs.fetchFromGitHub {
owner = "nixos";
repo = "hydra";
rev = "e0f204f3da6245fbaf5cb9ef59568b775ddcb929";
sha256 = "66002da8d68027b8a5edaf03bd81dd8b6327397311d71398776e1d3ef1ec96e1";
});
});
imports = [
View traverseConcurrentlyWith.hs
traverseConcurrentlyWith :: Traversable f => Int -> (a -> IO b) -> f a -> IO (f b)
traverseConcurrentlyWith count f t0 = do
(queue, t1) <- atomically $ do
queueDList <- newTVar id
t1 <- for t0 $ \x -> do
res <- newEmptyTMVar
modifyTVar queueDList (((x, res):) .)
pure . atomically $ takeTMVar res
dlist <- readTVar queueDList
queue <- newTVar $ dlist []
View ghcopts.cabal
# ghc-options:
# - -Weverything
# - -Wno-missing-exported-signatures # missing-exported-signatures turns off the more strict -Wmissing-signatures. See https://ghc.haskell.org/trac/ghc/ticket/14794#ticket
# - -Wno-missing-import-lists # Requires explicit imports of _every_ function (e.g. '$'); too strict
# - -Wno-missed-specialisations # When GHC can't specialize a polymorphic function. No big deal and requires fixing underlying libraries to solve.
# - -Wno-all-missed-specialisations # See missed-specialisations
# - -Wno-unsafe # Don't use Safe Haskell warnings
# - -Wno-missing-local-signatures # Warning for polymorphic local bindings. Don't think this is an issue
# - -Wno-monomorphism-restriction # Don't warn if the monomorphism restriction is used
@o1lo01ol1o
o1lo01ol1o / default.nix
Created Apr 27, 2018
transient-universe and nix
View default.nix
# default.nix
{}:
(import ./reflex-platform{}).project ({ pkgs, ... }:
{
packages = {
common = ./common;
backend = ./backend;
frontend = ./frontend;
@o1lo01ol1o
o1lo01ol1o / dataFamiliesVsTypeFamiliesVsGADTs.md
Last active Dec 6, 2017
Cheat sheet for haskell type level extenions.
View dataFamiliesVsTypeFamiliesVsGADTs.md

To your other, more general question, "the uses of data families as distinct from type families and GADTs". Here's the space of possibilities: ​

  1. Is the type constructor generative and injective, and can it be partially applied?
  2. Is there a runtime tag passed along with the value to pattern match on?
  3. Can it be closed, can it be open? ​ And here's where GADTs and type/data families lie in this space: ​
View keybase.md

Keybase proof

I hereby claim:

  • I am o1lo01ol1o on github.
  • I am o1lo01ol1o (https://keybase.io/o1lo01ol1o) on keybase.
  • I have a public key ASAohfPzXdT8Wyi8YU0niXf89Jq--Mei5gg4FDVPwtKnbAo

To claim this, I am signing this object:

@o1lo01ol1o
o1lo01ol1o / gadtgraph.hs
Last active Jul 18, 2017
(Unsuccessful) Attempt at encoding type-level graph with constraints
View gadtgraph.hs
--Pragmas are needed additionally for the project in which this snippet is included
{-# LANGUAGE TypeInType, DataKinds, PolyKinds, ScopedTypeVariables,
FlexibleInstances, FlexibleContexts, GADTs, TypeFamilies,
RankNTypes, LambdaCase, TypeOperators, TemplateHaskell,
ConstraintKinds, PolyKinds, NoImplicitPrelude,
UndecidableInstances, MultiParamTypeClasses, GADTSyntax,
AllowAmbiguousTypes, InstanceSigs, DeriveFunctor,
FunctionalDependencies #-}
-- Algebra.Graph is from the algebraic-graphs package
You can’t perform that action at this time.