We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7ea8fe2 + 37d4f26 commit 635bd41Copy full SHA for 635bd41
src/primitives.jl
@@ -68,6 +68,26 @@ function tuple_of_arrays(a)
68
t1,t2 = tuple_of_arrays(y)
69
(x,t1,t2)
70
end
71
+ function take(a, ::Type{Tuple{A,B,C,D}} where {A,B,C,D})
72
+ x, y = first_and_tail(a)
73
+ t1, t2, t3 = tuple_of_arrays(y)
74
+ (x, t1, t2, t3)
75
+ end
76
+ function take(a, ::Type{Tuple{A,B,C,D,E}} where {A,B,C,D,E})
77
78
+ t1, t2, t3, t4 = tuple_of_arrays(y)
79
+ (x, t1, t2, t3, t4)
80
81
+ function take(a, ::Type{Tuple{A,B,C,D,E,F}} where {A,B,C,D,E,F})
82
83
+ t1, t2, t3, t4, t5 = tuple_of_arrays(y)
84
+ (x, t1, t2, t3, t4, t5)
85
86
+ function take(a, ::Type{Tuple{A,B,C,D,E,F,G}} where {A,B,C,D,E,F,G})
87
88
+ t1, t2, t3, t4, t5, t6 = tuple_of_arrays(y)
89
+ (x, t1, t2, t3, t4, t5, t6)
90
91
# this one is type instable, why? Previous methods for take are for circumvent this issue.
92
function take(a,::Type)
93
x, y = first_and_tail(a)
0 commit comments