indexとtabulateとpositionsの意味
Representable型クラスのmethodの、命名の意味
明らかに圏論由来の命名ではなく、
ユースケースに沿った命名が為されている
index
関数 index
は、
与えられた Stream a
に対し、
位置(いわゆるインデックス) n
に対応する要素 x
を返す
具体化した型を見ればわかりやすい
index :: Stream a -> Integer -> a
単純にインデックスを指定して対応する要素を取得するので index
という名前なんだろう
近い名前で言えば lookup
とか
tabulate
関数 tabulate
は、
「位置 n
に対応する要素 x
を返す」関数から
Stream a
を生成する
具体化した型を見ればわかりやすい
tabulate :: (Integer -> a) -> Stream a
Streamの場合は、与えられた規則に則った無限列を作る関数
tabulate :: 規則 -> 無限列
tabulate
は直訳すると表形式
表形式のイメージ
この図のfとかgとか書かれているところは、関数を表形式で定義したものである
表形式(tabulate)を作成するための関数なので tabulate
という名前なんだろう
説明の中の自然な英語で tabulate
が出現してる例
>The representing object, the type a in C(a, -), is thought of as the key type, with which we can access the tabulated values of a function. ref
representing object
は、
Rep f
のこと

Stream a
の例で言えば Integer
のこと
index
は、「key」とも言える
positions
index :: コンテナ -> インデックス → そこの値
、 tabulate :: 規則 -> コンテナ
と言い表すと、
positions
は インデックスのコンテナ
を表す
「positions」は直訳すると「位置」
インデックスのコンテナ
なので、 インデックス集
だから「位置たち」
と言われればそんな気もする
