on master help sign in
Merge branch 'master' into JavaBackendFixes
commit5cad34bc701e0706ba7cde1d0197d4da62dff28c authorJan Bessai <Jan.Bessai@tu-dortmund.de> dateSat 7 Jun 2014, 22:46 (12 years ago) parent6a3aac2db92986
3 files changed+10−3
idris.cabal+1−1 libs/prelude/Prelude/Strings.idr+5−1 libs/prelude/Prelude/Vect.idr+4−1
idris.cabal+1−1
@@ -639,7 +639,7 @@ Library
639639 , xml
640640 , deepseq
641641 , zlib
642− , optparse-applicative
642+ , optparse-applicative >= 0.8
643643 Extensions: MultiParamTypeClasses
644644 , FunctionalDependencies
645645 , FlexibleContexts
libs/prelude/Prelude/Strings.idr+5−1
@@ -218,9 +218,13 @@ lines s = map pack $ lines' $ unpack s
218218
219219partial
220220foldr1 : (a -> a -> a) -> List a -> a
221−foldr1 f [x] = x
221+foldr1 _ [x] = x
222222foldr1 f (x::xs) = f x (foldr1 f xs)
223223
224+partial
225+foldl1 : (a -> a -> a) -> List a -> a
226+foldl1 f (x::xs) = foldl f x xs
227+
224228||| Joins the character lists by spaces into a single character list.
225229|||
226230||| Idris> unwords' [['A'], ['B', 'C'], ['D'], ['E']]
libs/prelude/Prelude/Vect.idr+4−1
@@ -260,10 +260,13 @@ concat : Vect m (Vect n a) -> Vect (m * n) a
260260concat [] = []
261261concat (v::vs) = v ++ concat vs
262262
263−||| Fold without seeding the accumulator
263+||| Foldr without seeding the accumulator
264264foldr1 : (t -> t -> t) -> Vect (S n) t -> t
265265foldr1 f (x::xs) = foldr f x xs
266266
267+||| Foldl without seeding the accumulator
268+foldl1 : (t -> t -> t) -> Vect (S n) t -> t
269+foldl1 f (x::xs) = foldl f x xs
267270--------------------------------------------------------------------------------
268271-- Scans
269272--------------------------------------------------------------------------------