Skip to content

Instantly share code, notes, and snippets.

@cdepillabout
cdepillabout / stretchly.nix
Created Apr 13, 2019
nix file for stretchly
View stretchly.nix
with (import ~/git/nixpkgs {});
let
libs = [
alsaLib
at-spi2-atk
atk
cairo
cups
dbus
@cdepillabout
cdepillabout / example.hs
Created Apr 11, 2019
show how quantifiedconstraints can be used for writing highly polymorphic versions of functions like pure
View example.hs
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -Wall #-}
module MaybeT where
View maybet.hs
{-# LANGUAGE InstanceSigs #-}
module MaybeT where
import Control.Monad.Trans
newtype MaybeT m a = MaybeT { unMaybeT :: m (Maybe a) }
instance MonadTrans MaybeT where
lift :: Monad m => m a -> MaybeT m a
@cdepillabout
cdepillabout / cudatoolkit-release-18.09-and-19.03.diff
Created Mar 20, 2019
Git diff between cudatoolkit derivation from release-18.09 and release-19.03 branch
View cudatoolkit-release-18.09-and-19.03.diff
$ git diff release-18.09 release-19.03 -- pkgs/development/compilers/cudatoolkit/default.nix
diff --git a/pkgs/development/compilers/cudatoolkit/default.nix b/pkgs/development/compilers/cudatoolkit/default.nix
index e44c21abe94..3a34d14f8ad 100644
--- a/pkgs/development/compilers/cudatoolkit/default.nix
+++ b/pkgs/development/compilers/cudatoolkit/default.nix
@@ -1,6 +1,6 @@
-{ lib, stdenv, makeWrapper, fetchurl, requireFile, perl, ncurses, expat, python27, zlib
-, gcc48, gcc49, gcc5, gcc6
-, xorg, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib, glibc
+{ lib, stdenv, makeWrapper, fetchurl, requireFile, perl, ncurses5, expat, python27, zlib
@cdepillabout
cdepillabout / set-proof-example.idr
Created Dec 4, 2018
Some proofs of simple things from set theory, including how to define power sets and subsets. All in Idris.
View set-proof-example.idr
module Set2
--
-- This module has some proofs of things from set theory. Inspired by
-- chapter 13 of the book Type Theory and Formal Proofs.
--
-- A power set of some given set s.
PowerSet : (s : Type) -> Type
PowerSet s = s -> Type
View gist:5485f1160b8597eede7790a1722f5b5f
these derivations will be built:
/nix/store/x5bvnh074wh774yd3n73zgylicjxf408-gi-gdk-3.0.16.drv
/nix/store/8smaas6jq95knzqbw6inlfhlw97bla0y-gi-gtk-3.0.25.drv
/nix/store/4a8avkmjxv5sb30qzcshshlx92pwwww0-gi-vte-2.91.19.drv
/nix/store/912iwrga7jvxn3vawab29hmnfsrpsv3z-termonad-1.0.0.0.drv
/nix/store/br77czswyk786k0ak8j4hwradp2xxbxw-ghc-8.4.4-with-packages.drv
/nix/store/g8gags5q5hiiqpzxx45y1kwzf0xkvmf9-termonad-with-packages-8.4.4.drv
building '/nix/store/x5bvnh074wh774yd3n73zgylicjxf408-gi-gdk-3.0.16.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/dxljd69cp3m5cgfl53h0fjbq202m0fm7-ghc-8.4.4.
View envvar.txt
AR=ar
AR_FOR_TARGET=ar
AS=as
AS_FOR_TARGET=as
CC=gcc
CC_FOR_TARGET=gcc
CONFIG_SHELL=/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin/bash
CXX=g++
CXX_FOR_TARGET=g++
DISPLAY=localhost:10.0
View list-of-flags.txt
'--cc=/nix/store/10yq7kwlvbc6h658izmrlsspry1g9f3c-gcc-wrapper-7.3.0/bin/cc'
'--cflag=-D__GLASGOW_HASKELL__=804'
'--cflag=-Dlinux_BUILD_OS=1'
'--cflag=-Dlinux_HOST_OS=1'
'--cflag=-Dx86_64_BUILD_ARCH=1'
'--cflag=-Dx86_64_HOST_ARCH=1'
'--cflag=-I.stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1/build/autogen'
'--cflag=-I.stack-work/dist/x86_64-linux-nix/Cabal-2.2.0.1/build/global-autogen'
'--cflag=-I/home/illabout/.stack/snapshots/x86_64-linux-nix/lts-12.13/8.4.3/lib/x86_64-linux-ghc-8.4.3/network-2.6.3.6-2g6VId0Xlc85XRtUcfQj0T/include'
'--cflag=-I/home/illabout/.stack/snapshots/x86_64-linux-nix/lts-12.13/8.4.3/lib/x86_64-linux-ghc-8.4.3/primitive-0.6.3.0-DaZpcxwJp2TGn8ITSgfI4C/include'
@cdepillabout
cdepillabout / a-poset-lemma.hs
Created Nov 12, 2018
proving a lemma about least elements in posets in Haskell using singletons
View a-poset-lemma.hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
@cdepillabout
cdepillabout / my-ghc-8.6.2.nix
Created Nov 11, 2018
A length-indexed list where the length is ad-hoc polymorphic (using singletons)
View my-ghc-8.6.2.nix
let
nixpkgsTarball = builtins.fetchTarball {
name = "nixos-unstable-2018-11-09";
url = https://github.com/nixos/nixpkgs/archive/1c49226176d248129c795f4a654cfa9d434889ae.tar.gz;
sha256 = "0v8vp38lh6hqazfwxhngr5j96m4cmnk1006kh5shx0ifsphdip62";
};
nixpkgs = import nixpkgsTarball { };
in