モド 配列の次元取得
Declare PtrSafe Function Dimension Lib "mapM.dll" (ByRef v As Variant) As Long
 
次元ジゲン上限ジョウゲンなし。配列でなければ0。
'プレースホルダ・オブジェクトの生成
Declare PtrSafe Function placeholder Lib "mapM.dll" (Optional ByVal n As Long = 0) As Variant
プレースホルダ・オブジェクト判定
Declare PtrSafe Function is_placeholder Lib "mapM.dll" (ByRef v As Variant) As Long
bindされていないVBA関数を2引数で呼び出す
Declare PtrSafe Function unbind_invoke Lib "mapM.dll" ( _
                ByRef pCallback As Variant, _
            ByRef param1 As Variant, _
        ByRef param2 As Variant) As Variant
モド 配列matrixの各要素elemに関数を適用する
Declare PtrSafe Function mapF_imple Lib "mapM.dll" ( _
                ByRef pCallback As Variant, _
            ByRef matrix As Variant) As Variant
配列matrix1とmatrix2の各要素に2変数の関数を適用する
Declare PtrSafe Function zipWith Lib "mapM.dll" ( _
                ByRef pCallback As Variant, _
            ByRef matrix1 As Variant, _
        ByRef matrix2 As Variant) As Variant
 
printM  zipWith(p_plus, iota(1, 5), iota(100, 104))
  101  103  105  107  109
↑ Array(1 + 100, 2 + 101, 3 + 102, 4 + 103, 5 + 104) とオナ
matrix1とmatrix2はオナ次元ジゲン配列ハイレツ
値はそれらオナじ次ジゲンの配ハイレツ列でカクジクナガさはミジカホウわせられる
モド 3次元までの配列に対する特定の軸に沿った畳み込み(初期値指定あり)
Declare PtrSafe Function foldl Lib "mapM.dll" ( _
                    ByRef pCallback As Variant, _
                ByRef init As Variant, _
            ByRef matrix As Variant, _
        Optional ByVal axis As Long = 1) As Variant
 
?foldl(p_minus, 100, iota(1, 5))
85
↑ ((((100 - 1) - 2) - 3) - 4) - 5 オナと同じ
値は引数ヒキスウmatrixの次元ジゲンシタガ以下イカカタチになる
1次ジゲン元 : スカラー
2次元ジゲン : 1次元配列ハイレツ
3次元ジゲン : 2次元配列
3次元までの配列に対する特定の軸に沿った畳み込み(初期値指定あり)
Declare PtrSafe Function foldr Lib "mapM.dll" ( _
                    ByRef pCallback As Variant, _
                ByRef init As Variant, _
            ByRef matrix As Variant, _
        Optional ByVal axis As Long = 1) As Variant
 
?foldr(p_minus, 100, iota(1, 5))
モド -97
↑ 1 - (2 - (3 - (4 - (5 - 100)))) オナと同じ
値は引数ヒキスウmatrixの次元ジゲンシタガ以下イカカタチになる
1次ジゲン元 : スカラー
2次元ジゲン : 1次元配列ハイレツ
3次元ジゲン : 2次元配列
3次元までの配列に対する特定の軸に沿った畳み込み(先頭要素を初期値とする)
Declare PtrSafe Function foldl1 Lib "mapM.dll" ( _
                ByRef pCallback As Variant, _
            ByRef matrix As Variant, _
        Optional ByVal axis As Long = 1) As Variant
 
m = makeM(3, 3, iota(1, 9)) : printM  m
  1  2  3
  4  5  6
  7  8  9
printM  foldl1(p_plus, m, 1)      ' ↓方向ホウコウにfold
モド   12  15  18
printM  foldl1(p_plus, m, 2)      ' →方向にfold
  6  15  24
値は引数ヒキスウmatrixの次元ジゲンシタガ以下イカカタチになる
1次ジゲン元 : スカラー
2次元ジゲン : 1次元配列ハイレツ
3次元ジゲン : 2次元配列
3次元までの配列に対する特定の軸に沿った畳み込み(末尾要素を初期値とする)
Declare PtrSafe Function foldr1 Lib "mapM.dll" ( _
                ByRef pCallback As Variant, _
            ByRef matrix As Variant, _
        Optional ByVal axis As Long = 1) As Variant
 
m = makeM(3, 3, iota(1, 9)) : printM  m
  1  2  3
  4  5  6
  7  8  9
モド printM  foldr1(p_minus, m, 1)      ' ↑方向にfold
  4  5  6
printM  foldr1(p_minus, m, 2)      ' ←方向にfold
  2  5  8
値は引数ヒキスウmatrixの次元ジゲンシタガ以下イカカタチになる
1次ジゲン元 : スカラー
2次元ジゲン : 1次元配列ハイレツ
3次元ジゲン : 2次元配列
3次元までの配列に対する特定の軸に沿ったscan(初期値指定あり)
Declare PtrSafe Function scanl Lib "mapM.dll" ( _
                    ByRef pCallback As Variant, _
                ByRef init As Variant, _
            ByRef matrix As Variant, _
        Optional ByVal axis As Long = 1) As Variant
 
printM  scanl(p_plus, 100, iota(1, 5))
モド   100  101  103  106  110  115
値は引数ヒキスウmatrixとオナ次元ジゲン配列ハイレツ
3次元までの配列に対する特定の軸に沿ったscan(初期値指定あり)
Declare PtrSafe Function scanr Lib "mapM.dll" ( _
                    ByRef pCallback As Variant, _
                ByRef init As Variant, _
            ByRef matrix As Variant, _
        Optional ByVal axis As Long = 1) As Variant
 
printM  scanr(p_plus, 100, iota(1, 5))
  115  114  112  109  105  100
値は引数ヒキスウmatrixとオナ次元ジゲン配列ハイレツ
3次元までの配列に対する特定の軸に沿ったscan(先頭要素を初期値とする)
Declare PtrSafe Function scanl1 Lib "mapM.dll" ( _
                ByRef pCallback As Variant, _
            ByRef matrix As Variant, _
モド         Optional ByVal axis As Long = 1) As Variant
 
printM  scanl1(p_plus, iota(1, 5))
  1  3  6  10  15
値は引数ヒキスウmatrixとオナ次元ジゲン配列ハイレツ
3次元までの配列に対する特定の軸に沿ったscan(末尾要素を初期値とする)
Declare PtrSafe Function scanr1 Lib "mapM.dll" ( _
                ByRef pCallback As Variant, _
            ByRef matrix As Variant, _
        Optional ByVal axis As Long = 1) As Variant
 
printM  scanr1(p_plus, iota(1, 5))
  15  14  12  9  5
値は引数ヒキスウmatrixとオナ次元ジゲン配列ハイレツ
1次元配列のソートインデックス出力
Declare PtrSafe Function stdsort Lib "mapM.dll" (ByRef ary As Variant, _
モド                                          ByVal defaultFlag As Long, _
                                         ByRef pComp As Variant) As Variant
 
→sortIndex
述語による検索
Declare PtrSafe Function find_imple Lib "mapM.dll" ( _
                ByRef pCallback As Variant, _
            ByRef matrix As Variant, _
        ByVal def As Long) As Long
 
→find_pred
関数適用のループ(+ 終了条件)
Declare PtrSafe Function repeat_imple Lib "mapM.dll" ( _
                        ByRef init As Variant, _
                    ByRef pred As Variant, _
                ByRef trans As Variant, _
            ByVal maxN As Long, _
        ByVal scan As Long, _
    ByVal stopCondition As Long) As Variant
 
モド →repeat_while
VARIANT変数どうしのスワップ
Declare PtrSafe Function swapVariant Lib "mapM.dll" (ByRef a As Variant, ByRef b As Variant) As Long
 
a = Array(1, 2, 3)
b オオ大きな配ハイレツ
a(0) = b                          ← コピー発ハッセイ
swapVariant a(0), b        ← コピーなし (b = 1 となる)
配列のLBound変更
Declare PtrSafe Sub changeLBound Lib "mapM.dll" (ByRef v As Variant, ByVal lbound_v As Long)
 
ジゲンベツ別に設定セッテイはできない
1次元配列の離れた要素間で2項操作を適用する
Declare PtrSafe Function self_zipWith Lib "mapM.dll" (ByRef pCallback As Variant, _
                                                                      ByRef vec As Variant, _
                                                                     ByVal shift As Long) As Variant
 
vec = Array(1, 2, 3, 4, 5, 6)
printM self_zipWith(p_plus, vec, 1)
  3  5  7  9  11  7               '  <=  vec と rotation(vec, 1) との操作ソウサ
printM self_zipWith(p_plus, vec, -1)
  7  3  5  7  9  11               '  <=  vec と rotation(vec, -1) との操作