Commit 0c8d6209 authored by Steffen Michels's avatar Steffen Michels

remove minimum/maximum from Data.List, as it is provided by Data.Foldable

parent 483b0ab0
Pipeline #18018 passed with stage
in 2 minutes and 48 seconds
......@@ -14,6 +14,7 @@ import Data.List
import Data.Maybe
import Data.Functor
import Data.GenLexOrd
from Data.Foldable import minimum, maximum
unLPath :: (LPath a) -> [LNode a]
unLPath (LP xs) = xs
......
......@@ -86,8 +86,6 @@ transpose :: ![[a]] -> [.[a]]
subsequences :: .[a] -> .[[a]]
permutations :: [a] -> .[[a]]
concatMap :: (.a -> [.b]) ![.a] -> [.b]
maximum :: !.[a] -> a | < a
minimum :: !.[a] -> a | Ord a
getItems :: ![a] ![Int] -> [a]
scanl :: (a -> .(.b -> a)) a [.b] -> .[a]
scanl1 :: (a -> .(a -> a)) !.[a] -> .[a]
......
......@@ -154,14 +154,6 @@ permutations xs0 = [xs0 : perms xs0 []]
concatMap :: (.a -> [.b]) ![.a] -> [.b]
concatMap f ls = flatten (map f ls)
maximum :: !.[a] -> a | < a
maximum [x] = x
maximum [x:xs] = max x (maximum xs)
maximum [] = abort "maximum of empty list\n"
minimum :: !.[a] -> a | Ord a
minimum xs = foldl1 min xs
getItems :: ![a] ![Int] -> [a]
getItems list indexes = [x \\ x <- list & idx <- [0..] | isMember idx indexes]
......
implementation module System.GetOpt
import StdEnv, Text, Data.Maybe, Data.Either
from Data.List import maximum, isnull, find, concatMap, unzip3, zipWith3
from Data.Foldable import maximum
from Data.List import isnull, find, concatMap, unzip3, zipWith3, instance Foldable []
:: OptKind a // kind of cmd line arg (internal use only):
= Opt a // an option
......
......@@ -12,7 +12,8 @@ import StdFunc
//Data
import Data.Maybe, Data.Func
from Data.List import maximum
from Data.List import instance Foldable []
from Data.Foldable import maximum
//System
import System.FilePath
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment