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.
extend
Array
1 parent c393ee5 commit e2ce8e0Copy full SHA for e2ce8e0
src/Control/Extend.js
@@ -0,0 +1,9 @@
1
+"use strict";
2
+
3
+exports.arrayExtend = function(f) {
4
+ return function(xs) {
5
+ return xs.map(function (_, i, xs) {
6
+ return f(xs.slice(i));
7
+ });
8
+ };
9
+};
src/Control/Extend.purs
@@ -27,6 +27,11 @@ class Functor w <= Extend w where
27
instance extendFn :: Semigroup w => Extend ((->) w) where
28
extend f g w = f \w' -> g (w <> w')
29
30
+foreign import arrayExtend :: forall a b. (Array a -> b) -> Array a -> Array b
31
32
+instance extendArray :: Extend Array where
33
+ extend = arrayExtend
34
35
infixr 1 extend as <<=
36
37
-- | A version of `extend` with its arguments flipped.
0 commit comments