X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Ftests%2Fprograms%2Fipoole_spec_class%2FGoferPreludeBits.lhs;fp=ghc%2Ftests%2Fprograms%2Fipoole_spec_class%2FGoferPreludeBits.lhs;h=0000000000000000000000000000000000000000;hb=16acb4976514ab4b03c79d6845e3f0e98a1a33cf;hp=10d9ca1d0da1a581098b7577e1d051ca1c1c405b;hpb=f2eadfd5dfb23cc611e2540f46180bca7d095f15;p=ghc-hetmet.git diff --git a/ghc/tests/programs/ipoole_spec_class/GoferPreludeBits.lhs b/ghc/tests/programs/ipoole_spec_class/GoferPreludeBits.lhs deleted file mode 100644 index 10d9ca1..0000000 --- a/ghc/tests/programs/ipoole_spec_class/GoferPreludeBits.lhs +++ /dev/null @@ -1,59 +0,0 @@ -\begin{vb} - -> module GoferPreludeBits where - -This script contains some useful functions taken from the standard -Gofer prelude, but which do not appear in the Haskell prelude - -SCCS: %W% %G% - -> -> copy :: Int -> a -> [a] -- make list of n copies of x -> copy n x = take n xs where xs = x:xs - - -> cjustify, ljustify, rjustify :: Int -> String -> String - -> cjustify n s = space halfm ++ s ++ space (m - halfm) -> where m = n - length s -> halfm = m `div` 2 -> ljustify n s = s ++ space (n - length s) -> rjustify n s = space (n - length s) ++ s - -> space :: Int -> String -> space n = copy n ' ' - -> layn :: [String] -> String -> layn = lay (1::Int) where lay _ [] = [] -> lay n (x:xs) = rjustify 4 (show n) ++ ") " -> ++ x ++ "\n" ++ lay (n+1) xs - -> -- Merging and sorting lists: - -> merge :: Ord a => [a] -> [a] -> [a] -> merge [] ys = ys -> merge xs [] = xs -> merge (x:xs) (y:ys) -> | x <= y = x : merge xs (y:ys) -> | otherwise = y : merge (x:xs) ys - -> sort :: Ord a => [a] -> [a] -> sort = foldr insert [] - -> insert :: Ord a => a -> [a] -> [a] -> insert x [] = [x] -> insert x (y:ys) -> | x <= y = x:y:ys -> | otherwise = y:insert x ys - -> qsort :: Ord a => [a] -> [a] -> qsort [] = [] -> qsort (x:xs) = qsort [ u | u<-xs, u [ x ] ++ -> qsort [ u | u<-xs, u>=x ] - -> --1.3: undefined = error "undefined" - -\end{vb} - -