Ticket #52: indexed.dpatch

File indexed.dpatch, 2.3 kB (added by Khudyakov, 2 years ago)
Line 
11 patch for repository http://code.haskell.org/vector:
2
3Thu Mar 10 21:19:37 MSK 2011  Khudyakov Alexey <alexey.skladnoy@gmail.com>
4  * Add 'indexed' function
5
6New patches:
7
8[Add 'indexed' function
9Khudyakov Alexey <alexey.skladnoy@gmail.com>**20110310181937
10 Ignore-this: e386379354575a8df3012d0eee718c39
11] {
12hunk ./Data/Vector.hs 84
13 
14   -- * Elementwise operations
15 
16+  -- ** Indexing
17+  indexed,
18+
19   -- ** Mapping
20   map, imap, concatMap,
21 
22hunk ./Data/Vector.hs 726
23 {-# INLINE modify #-}
24 modify p = G.modify p
25 
26+-- Indexing
27+-- --------
28+
29+-- | /O(n)/ Pair each element in a vector with its index
30+indexed :: Vector a -> Vector (Int,a)
31+{-# INLINE indexed #-}
32+indexed = G.indexed
33+
34 -- Mapping
35 -- -------
36 
37hunk ./Data/Vector/Generic.hs 74
38 
39   -- * Elementwise operations
40 
41+  -- ** Indexing
42+  indexed,
43+
44   -- ** Mapping
45   map, imap, concatMap,
46 
47hunk ./Data/Vector/Generic.hs 858
48 {-# INLINE modifyWithStream #-}
49 modifyWithStream p v s = new (New.modifyWithStream p (clone v) s)
50 
51+-- Indexing
52+-- --------
53+
54+-- | /O(n)/ Pair each element in a vector with its index
55+indexed :: (Vector v a, Vector v (Int,a)) => v a -> v (Int,a)
56+{-# INLINE indexed #-}
57+indexed = unstream . inplace MStream.indexed . stream
58+
59 -- Mapping
60 -- -------
61 
62hunk ./Data/Vector/Unboxed.hs 97
63 
64   -- * Elementwise operations
65 
66+  -- ** Indexing
67+  indexed,
68+
69   -- ** Mapping
70   map, imap, concatMap,
71 
72hunk ./Data/Vector/Unboxed.hs 706
73 {-# INLINE modify #-}
74 modify p = G.modify p
75 
76+-- Indexing
77+-- --------
78+
79+-- | /O(n)/ Pair each element in a vector with its index
80+indexed :: Unbox a => Vector a -> Vector (Int,a)
81+{-# INLINE indexed #-}
82+indexed = G.indexed
83+
84 -- Mapping
85 -- -------
86 
87}
88
89Context:
90
91[TAG 0.7.0.1
92Roman Leshchinskiy <rl@cse.unsw.edu.au>**20101104225111
93 Ignore-this: e619f4e63ff96ca2b7c7753fdd53a4b
94]
95[Bump versions and modify flags in benchmarks
96Roman Leshchinskiy <rl@cse.unsw.edu.au>**20101104223856
97 Ignore-this: 23c742cd11bb4102b7da27f3fe714c41
98]
99[Don't use package ghc
100Roman Leshchinskiy <rl@cse.unsw.edu.au>**20101104223805
101 Ignore-this: e4d43fa6b80288568304f687ed36f49f
102]
103[Bump version number
104Roman Leshchinskiy <rl@cse.unsw.edu.au>**20101104223731
105 Ignore-this: 3fb2760ba56b833fb97b958f9bd400b6
106]
107[TAG 0.7
108Roman Leshchinskiy <rl@cse.unsw.edu.au>**20100920002654
109 Ignore-this: 77ac1b66fdd584f1c40e4e1597c228c
110]
111Patch bundle hash:
112be5c0e9db4ae9b790c07ce62fb6a23e84793c5c4