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
| import System.Environment (getArgs) | |
| import Control.Monad (mapM_) | |
| import Data.Functor ((<$>)) | |
| import Data.String.Utils (replace) -- missingH | |
| import System.IO.UTF8 (putStrLn, readFile) -- utf8-string | |
| import Prelude hiding (putStrLn, readFile) | |
| main :: IO () | |
| main = main' =<< getArgs |
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
| ;; The following implementation of rb-tree is based on http://www.cs.kent.ac.uk/people/staff/smk/redblack/. | |
| (defun change-to-black (tree) | |
| (pattern-match tree | |
| ((:pattern (_ . rest) :variable rest :ignore _) `(:B . ,rest)) | |
| (:otherwise nil))) | |
| (defun rb-insert (tree obj cmp) | |
| (change-to-black (rb-insert% tree obj cmp))) |
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
| ; sets as unordered lists: | |
| ; a set for now is defined as as being able | |
| ; to undergo the following operations | |
| ; 1) element-of-set? checks if x is in set | |
| (define (element-of-set? x set) | |
| (cond ((null? set) false) | |
| ((equal? x (car set)) true) | |
| (else (element-of-set? x (cdr set))))) |
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 #-} | |
| import Turtle | |
| import Data.Text (words) | |
| rpmspecSrc qf spec = do | |
| (_res, out) <- procStrict "rpmspec" ["-q", "--srpm", "--undefine=dist", "--qf", qf, spec] empty | |
| return out | |
| nvr = "%{name}-%{version}-%{release}" |
NewerOlder