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 Main where | |
import qualified Data.Vector as V | |
printArray :: (Integral a, Show a) => V.Vector a -> IO () | |
printArray x = mapM_ printLine $ reverse [1 .. maxElem] | |
where | |
printLine n = (putWithOffset $ show n) >> mapM_ (putFiller n) [0 .. (V.length x)-1] >> putChar '\n' | |
putWithOffset s | |
| length s < numberOffset = putStr s >> mapM_ (\x -> putChar ' ') [1 .. (length s) - numberOffset] |
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 OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Control.Monad (forever) | |
import Data.Maybe (catMaybes) | |
import Data.List (find) | |
data Expression = | |
ExprLiteral Double |
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: d | |
install: | |
- DMD_VER=2.065.0 | |
- DMD=dmd_${DMD_VER}-0_amd64.deb | |
- DUB_VER=0.9.21 | |
- DUB=dub-${DUB_VER}-linux-x86_64 | |
- wget http://downloads.dlang.org/releases/2014/${DMD} | |
- sudo dpkg -i ${DMD} || true | |
- sudo apt-get -y update |
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 UU.PPrint hiding ((<$>)) | |
import Data.List (nub, sortBy, elemIndex, groupBy) | |
import Data.Function (on) | |
import Data.Functor ((<$>)) | |
import Data.Maybe (fromJust, fromMaybe) | |
import Control.Arrow (first, second) | |
import GHC.Exts (the) | |
data Tree a b = Tree a [(b, Tree a b)] | |
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
VarName : Type | |
VarName = Nat | |
total | |
nameEq : (a : VarName) -> (b : VarName) -> Dec (a = b) | |
nameEq Z Z = Yes Refl | |
nameEq Z (S k) = No ZnotS | |
nameEq (S k) Z = No (negEqSym ZnotS) | |
nameEq (S k) (S j) with (nameEq k j) | |
| Yes p = Yes $ cong p |
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 Path | |
import Data.Vect | |
||| Graph defined by hops vector | |
Ways : Nat -> Type -> Type | |
Ways n a = Vect n (a, a) | |
||| Helper that points which transaction ways we need to use to traverse the given path | |
data PathElem : (ways : Ways k a) -> (begin : a) -> (path : Vect n a) -> (end : a) -> Type where |
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 OverloadedLists #-} | |
module Main where | |
import Data.Vector.Unboxed (Vector(..), fromList, (!?)) | |
import Data.List | |
import Data.Maybe (isJust) | |
import qualified Data.Vector.Unboxed as V | |
hasCycle1 :: (V.Unbox a, Eq a) => Vector a -> 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
# Patch ./linux/hl | |
patchelf --set-interpreter /nix/store/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/ld-linux-x86-64.so.2 ./linux/hl |
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
# Latest Nightly | |
with import <nixpkgs> {}; | |
let src = fetchFromGitHub { | |
owner = "mozilla"; | |
repo = "nixpkgs-mozilla"; | |
rev = "b9c99d043b1cb55ee8c08265223b7c35d687acb9"; | |
sha256 = "0akyhdv5p0qiiyp6940k9bvismjqm9f8xhs0gpznjl6509dwgfxl"; | |
}; | |
in | |
with import "${src.out}/rust-overlay.nix" pkgs pkgs; |
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
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, lib, pkgs, ... }: | |
with lib; | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
OlderNewer