依存型
dependent type
値に依存している型
値って値コンストラクタのことかmrsekut.icon*2
Vect n aのnとか、BoolのTrueとか
引数に依存してλ抽象の型が決まる
型をファーストクラスなものとして扱える
もしかして↑これは依存型の話ではなく、Idris特有の話 #??
型を値と同等の扱いができる
関数の引数に型を取れる
型宣言に関数を書ける
雰囲気はIdrisで依存型に触れるを参照
依存関数
依存和型
table:対応
依存される\依存する 項 型
項 普通の関数 依存型
型 多相型 高階多相型
ユースケース
型レベル自然数を用いて、行列同士の乗算 ref
code:hs
data Matrix (row :: Nat) (col :: Nat) = ... -- 行列を’表す型
prod :: Matrix a b -> Matrix b c -> Matrix a c -- 行列同士の乗算
参考
/mrsekut-book-4007305803/251 (依存型)
/mrsekut-book-4274069117/390 (30.5 発展: 依存型)
tapl
https://keens.github.io/slide/kansuugatade_takouzoutoizongatadoujinyuumon/
https://m-hiyama.hatenablog.com/entry/2020/10/21/175259
良さそうmrsekut.icon
https://staff.aist.go.jp/tanaka-akira/pub/2018-09-02-deptype-proofsummit2018.pdf
https://ja.wikipedia.org/wiki/依存型
http://www.cse.chalmers.se/~peterd/papers/DependentTypesAtWork.pdf
http://mandel59.hateblo.jp/entry/2013/09/25/043156
http://jats-ug.metasepi.org/doc/ATS2/INT2PROGINATS/c2228.html
/LugendrePublic/ゆうれい,いぞん,そんざい,ラァゥンクトゥゥポリモォフィジゥムッ
https://kagamilove0707.github.io/programming/2014/02/21/gadts-and-dependent-type/
https://qiita.com/junjihashimoto@github/items/31f245f5e0138e5fac7e
https://en.wikipedia.org/wiki/Dependent_type
Martin-Löf dependent type theory
https://ncatlab.org/nlab/show/Martin-Löf+dependent+type+theory
https://blog.jle.im/entry/practical-dependent-types-in-haskell-1.html
『The Little Typer』という本がかなり評判が良いっぽい
https://mandel59.hateblo.jp/entry/2013/09/25/043156
https://ncatlab.org/nlab/show/dependent+type+theory
https://www.infoq.com/presentations/scala-idris/
https://m-hiyama.hatenablog.com/entry/2021/01/14/120653
Kan拡張
https://m-hiyama.hatenablog.com/entry/2021/01/13/152901
圏論
http://ziphil.com/diary/mathematics/12.html
http://ziphil.com/diary/mathematics/11.html
http://ziphil.com/diary/mathematics/10.html
https://github.com/ollef/sixty
https://arxiv.org/abs/2204.05653
Functional Pearl: Dependent type inference via free higher-order unification
https://sititou70.github.io/Idrisでふんわり眺める依存型/
https://forest.cbult.space/math-00J2.xml
#型システム