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
import Init.Data.Ord | |
namespace Weekday | |
/- Weekdays -/ | |
inductive Weekday where | |
| monday : Weekday | |
| tuesday : Weekday | |
| wednesday : Weekday | |
| thursday : Weekday |
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
nix-repl> hp = pkgs.haskell.packages.ghc863.override { overrides = self: super: rec { funflow = self.callPackage ./. {}; }; } | |
nix-repl> :b hp.funflow |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"> | |
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script> | |
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style> | |
<body> | |
<div style="max-width:900px; -webkit-transform:rotate(0deg)"> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> |
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 Arrows #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE NoImplicitPrelude #-} | |
{-# LANGUAGE Rank2Types #-} | |
{-# LANGUAGE ScopedTypeVariables #-} |
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
{- | |
I have a type as the following: | |
```data Foo = | |
Foo1 (Either String Int) | |
| Foo2 (Either String Char) | |
| Foo3 (Either String Bar) | |
... | |
``` | |
There may end up being a lot of these. All will have `Either String a` inside. There are a bunch of functions taking a `Foo` argument. In most cases, the behaviour of how to treat a `Left` is the same, but for one, where it's important to know the constructor. I can't thus pull the `Either` out to the top level. Nor can I easily just turn the constructor into a tag, because it determines the type inside the `Right` |
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 nix-shell | |
#! nix-shell -i bash -p go-pup | |
WD="${1:-$HOME/nixpkgs}" | |
NIXEXPR="$WD/pkgs/applications/editors/sublime3-dev/default.nix" | |
LATEST_BUILD=$( curl -s http://www.sublimetext.com/3dev \ | |
| pup "h2" | grep Build | cut -d" " -f 3 | sort -rn | head -n 1) | |
SHA_32=$(curl -s "https://download.sublimetext.com/sublime_text_3_build_${LATEST_BUILD}_x32.tar.bz2" \ | |
| sha256sum | cut -d' ' -f1) |
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
# ~/.nixpkgs/config.nix | |
{ pkgs }: | |
{ | |
allowUnfree = true; | |
packageOverrides = self: rec { | |
haskellPackages = self.haskellPackages.override { | |
overrides = hsSelf: hsSuper: { | |
numhask = hsSelf.callPackage /home/nc/proj/numhask {}; |
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 DataKinds, FlexibleContexts, TypeOperators #-} | |
module Main where | |
import Data.Proxy | |
import Data.Vinyl | |
import Data.Vinyl.Derived | |
import Data.Vinyl.Functor | |
import Control.Applicative |
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 ChattyCalculator where | |
import Prelude hiding (exponent, subtract) | |
import Control.Applicative hiding ((<|>)) | |
import Data.List (intercalate) | |
import Text.Parsec | |
import Text.Parsec.Expr |
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 LambdaCase #-} | |
module Main where | |
import Control.Monad (liftM) | |
import qualified Data.ByteString.Char8 as B | |
import qualified Data.ByteString.Lazy.Char8 as LB | |
import qualified Data.Map as Map | |
import Data.Maybe (fromMaybe, catMaybes) | |
import Data.Monoid (mconcat) |
NewerOlder