Skip to content

Commit c656fa4

Browse files
Merge pull request #134 from garibarba/patch-1
Add more specialized functions
2 parents 9290072 + 5f5e01a commit c656fa4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/array_partition.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,16 @@ end
110110

111111
Base.:(==)(A::ArrayPartition,B::ArrayPartition) = A.x == B.x
112112

113-
## Functional Constructs
113+
## Iterable Collection Constructs
114114

115115
Base.mapreduce(f,op,A::ArrayPartition) = mapreduce(f,op,(mapreduce(f,op,x) for x in A.x))
116116
Base.any(f,A::ArrayPartition) = any(f,(any(f,x) for x in A.x))
117117
Base.any(f::Function,A::ArrayPartition) = any(f,(any(f,x) for x in A.x))
118+
Base.any(A::ArrayPartition) = any(identity, A)
119+
Base.all(f,A::ArrayPartition) = all(f,(all(f,x) for x in A.x))
120+
Base.all(f::Function,A::ArrayPartition) = all(f,(all(f,x) for x in A.x))
121+
Base.all(A::ArrayPartition) = all(identity, A)
122+
118123
function Base.copyto!(dest::AbstractArray,A::ArrayPartition)
119124
@assert length(dest) == length(A)
120125
cur = 1

0 commit comments

Comments
 (0)