This file contains hidden or 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 }: | |
with builtins; | |
with pkgs; | |
with lib.attrsets; | |
with stdenv; | |
with rec { | |
deepReadDir = path: | |
let | |
attrset = readDir path; | |
go = name: value: |
This file contains hidden or 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 builtins; | |
with (import <nixpkgs> { }); | |
with (import <nixpkgs> { }).lib.attrsets; | |
with (import <nixpkgs> { }).stdenv; | |
with rec { | |
deepReadDir = path: | |
let | |
attrset = readDir path; | |
go = name: value: | |
if value == "directory" then |
This file contains hidden or 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
data PriorityQueue k a = Nil | Branch k a (PriorityQueue k a) (PriorityQueue k a) | |
empty :: Ord k => PriorityQueue k a | |
empty = Nil | |
singleton :: Ord k => k -> a -> PriorityQueue k a | |
singleton k a = Branch k a Nil Nil | |
minKeyValue :: Ord k => PriorityQueue k a -> (k, a) | |
minKeyValue Nil = error "empty queue" |
This file contains hidden or 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
data Heap a = Empty | Heap a [(Heap a)] | |
deriving Show | |
singleton :: Ord a => a -> Heap a | |
singleton a = Heap a [] | |
findMin :: Heap a -> a | |
findMin (Heap h _) = h | |
minView :: Ord a => Heap a -> Maybe (a, Heap a) |
This file contains hidden or 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
data Tree a | |
= Leaf a | |
| Node (Tree a) a (Tree a) | |
deriving (Eq, Show) | |
dfLabel :: Tree a -> Tree Int | |
dfLabel = fst . go 0 where | |
go n (Leaf _) = (Leaf n, n+1) | |
go n (Node l _ r) = let | |
(l', n') = go (n+1) l |
This file contains hidden or 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
subGraphOfFirstCommonAncestor | |
o 7dbfc7 | |
| | |
o o 132823,193a16 | |
|/ | |
o 1d7bbd | |
| | |
o | |
resultHeads: (fromList [("master",Tran_193a16),("mergebranch_13282313-7fb3-4097-bf3a-e29c81dcfa1d",Tran_7dbfc7)]) |
This file contains hidden or 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 #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} |
This file contains hidden or 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 #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} |
NewerOlder