Skip to content

Instantly share code, notes, and snippets.

View aljce's full-sized avatar

Alice McKean aljce

  • Portland, OR
View GitHub Profile
@aljce
aljce / Pokemon.hs
Last active April 13, 2018 23:26
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeInType #-}
module Pokemon where
import Data.Kind (Type)
import Data.Void (Void)
import Type.Reflection ((:~:)(..))
Preprocessing library for kpf-0.1.0..
Building library for kpf-0.1.0..
[6 of 6] Compiling Hask.Functor.Compose ( Hask/Functor/Compose.hs, dist/build/Hask/Functor/Compose.o )
Hask/Functor/Compose.hs:21:10: error:
• solveWanteds: too many iterations (limit = 4)
Unsolved: WC {wc_simple =
[D] _ {0}:: Category s0 (CDictCan)
[D] _ {0}:: Category s0 (CDictCan)
[D] _ {0}:: Category s0 (CDictCan)
{ url # The Git revision of nixpkgs to fetch
, sha256 # The SHA256 of the downloaded .tar
, sha256unpacked # The SHA256 of the downloaded .nar
, system ? builtins.currentSystem # This is overridable if necessary
}:
with {
ifThenElse = { bool, thenValue, elseValue }: (
if bool then thenValue else elseValue);
};
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# OPTIONS_GHC -Wall -Werror -Wno-unticked-promoted-constructors #-}
-- | Conversion between unlifted and lifted datatypes
module Packed.Levity
( -- * Types
Rep
, Levity(..)
@aljce
aljce / Graph.hs
Last active December 30, 2018 23:01
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DeriveTraversable #-}
{-# OPTIONS_GHC -Wall -Werror #-}
module Data.Graph
( Graph
, empty
, insert
, edge
, neighbors
, vertices
newtype Region s a = Region (IO a) deriving (Functor, Applicative, Monad)
liftIO :: IO a -> Region s a
liftIO = Region
runRegion :: (forall s. Region s a) -> IO a
runRegion (Region x) = x
newtype Ref s a = Ref (IORef a)
# Using a specific checkout of nixpkgs makes it easy to debug as you know exactly what the deps are.
# This being said in production you should pass the global nixpkgs to this file.
let nixpkgs-src = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/56d94c8c69f8cac518027d191e2f8de678b56088.tar.gz";
sha256 = "1c812ssgmnmh97sarmp8jcykk0g57m8rsbfjg9ql9996ig6crsmi";
};
in
{ pkgs ? (import nixpkgs-src {}) }:
with pkgs;
with stdenv.lib;
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE UndecidableSuperClasses #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
module TypedClient

Keybase proof

I hereby claim:

  • I am mckeankylej on github.
  • I am mckeankylej (https://keybase.io/mckeankylej) on keybase.
  • I have a public key ASBU2f_UjGI8XMEQtK4hxpbLtTLJSt2bcWL0pfUYB2inVgo

To claim this, I am signing this object:

@aljce
aljce / shell.nix
Created September 8, 2019 01:40
A reproducible rust build environment
# A fully reproducible rust build environment via nix
# run `nix-shell` to enter the build enviroment
# run `nix-shell --argstr backtrace true` to enable backtracing
with rec {
fetch-github =
{ owner # The owner of the repo
, repo # The repo to fetch
, rev # The git commit hash you want
, sha256 # The SHA256 hash of the unpacked archive (for reproducibility)
}: builtins.fetchTarball {