This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TypeOperators #-} | |
-- Ignore the names, these are just tuples, not type lists | |
data major :. minor = major :. minor -- Row major shapes | |
data minor .: major = minor .: major -- Col major shapes | |
class Shape sh where | |
type Index sh | |
index :: sh -> Index sh -> Int | |
inRange :: sh -> Index sh -> Bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Data.Unfold where | |
import Control.Applicative | |
import Data.Foldable | |
import Data.Maybe (fromMaybe) | |
import Prelude hiding (foldl, foldr, repeat) | |
-- This is a useful abstraction that I haven't found on Hackage, but that | |
-- doesn't mean it's not there by some other name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Tee where | |
import Control.Concurrent (forkIO) | |
import Control.Exception (handle, throw) | |
import Control.Monad (forever, void) | |
import System.IO (Handle, hGetChar, hPutChar) | |
import System.IO.Error (isEOFError) | |
-- This implementation is actually worse than the lazy one! The lazy | |
-- implementation would lock up if all of the output handles became full; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs }: | |
{ | |
packageOverrides = self: rec { | |
haskellPackages_ghcHEAD = self.haskell.packages { | |
ghcPath = /home/shana/programming/ghc; | |
ghcBinary = self.haskellPackages.ghcPlain; | |
prefFun = self.haskell.ghcHEADPrefs; | |
extraArgs = { | |
happy = self.haskellPackages.happy_1_19_2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgs: | |
{ | |
packageOverrides = pkgs: with pkgs; rec { | |
hsDevTools = hsPkgs: [ | |
hsPkgs.cabalInstall | |
hsPkgs.ghcMod | |
]; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cabal configure && cabal build && cabal haddock --hyperlink-source \ | |
--html-location='/package/$pkg-$version/docs' \ | |
--contents-location='/package/$pkg' | |
S=$? | |
if [ "${S}" -eq "0" ]; then | |
cd "dist/doc/html" | |
DDIR="${1}-${2}-docs" | |
cp -r "${1}" "${DDIR}" && tar -c -v -z --format=ustar -f "${DDIR}.tar.gz" "${DDIR}" | |
CS=$? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xft.dpi: 96 | |
Xft.antialias: 1 | |
Xft.rgba: rgb | |
Xft.hinting: 1 | |
Xft.hintstyle: hintslight | |
Xft.lcdfilter: lcddefault | |
Xft.autohint: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghci> import Control.Monad (liftM) | |
ghci> :t liftM | |
liftM :: Monad m => (a1 -> r) -> m a1 -> m r | |
ghci> import Debug.Trace (trace) | |
ghci> liftM (\x -> trace "function applied" (x + 3)) [1 :: Int, 2, 3] | |
[function applied | |
4,function applied | |
5,function applied | |
6] | |
ghci> liftM (trace "function evaluated" (+ 3)) [1 :: Int, 2, 3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, fetchFromGitHub, cmake | |
, wayland, pixman, libxkbcommon, udev, libinput | |
, libX11, libxcb, x11 | |
, mesa #nvidia_x11 | |
, dbus, systemd | |
}: | |
let srcs = { | |
wlc = fetchFromGitHub { | |
owner = "Cloudef"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with (import <nixpkgs> {}).pkgs; | |
stdenv.mkDerivation rec { | |
name = "patchelf-0.9-pre"; | |
src = fetchgit { | |
url = https://github.com/NixOS/patchelf.git; | |
rev = "63296c4e18381216f740670916608f9ef159672e"; | |
sha256 = "b6b2b4891773ea9d36f1891082812a157b7a6097827594419fe4a4343aa403a1"; | |
}; |
OlderNewer