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
{-# 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
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
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
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
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
{-# 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
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] |
NewerOlder