GHC言語拡張勉強会 -Type application-
イベント内容
概要
Glasgow Haskell Compiler (以下 GHC) には、様々な言語拡張機能が存在します。
この勉強会では "Glasgow Haskell Compiler User's Guide" (以下 "GHC User's Guide") をベースに、 主に Type application に関する言語拡張の理解を深めることを目的としています。
目的
GHC 言語拡張の Type application に関する拡張の理解:
TypeApplications
備考 (2019-12-08 現在)
ScopedTypeVariables
: 関連する内容
- Kind: Kind に関する内容は、Kind 関係の言語拡張を後日取扱う際に改めて振り返る予定です。
想定する参加者
- Haskell (GHC) のソースコードにおいて
f @t e
という形式を見たことがある方 - "GHC User's Guide" の 'GHC Language Features' を読んでいない方
進め方
主に Discord のグループDM (10人まで) の音声通話と画面共有を用いて、"GHC User's Guide" (GHC 8.8.1) の PDF などを管理者が読み進めます。
その他、連絡事項や相談内容があれば、Discord のテキストチャットや connpass のイベント案内にてお伝え致します。
第02回の内容
"GHC User's Guide" (GHC 8.8.1 に準拠):
-
'9.19.2. Ordering of specified variables': 型注釈に記述した型変数の順番について
-
'9.11.4 Inferring the order of variables in a type/class declaration': 型注釈に記述しなかった (GHC の推論による) 型変数の順番について
-
"GHC 8.11.0.20191209 Users Guide: 4.2.1 Language":
8.10.1
で変更される予定Implicitly quantified kind variables are no longer put in front of other variables: (コード略)
This is a breaking change for users of TypeApplications.
-
参考(注: メモとして列挙しています)
-
"Haskell Report 2010"
-
'4.5 Static Semantics of Function and Pattern Bindings', 有志の方による日本語訳: 関数とパターン束縛の静的な意味論
-
'4.6 Kind Inference', 有志の方による日本語訳: カインドの推論
-
-
ghc
, (2019-12-09 追記): branch をghc-8.8.1-release
に修正しました-
'Note [ScopedSort]':
compiler/types/Type.hs
, 'ScopedSort' について -
Note [Ordering of implicit variables]:
compiler/rename/RnTypes.hs
, GHCの推論による型変数の順番について,hsSyn/HsTypes.hs
にも同様の記述あり -
Issues #15743: 'Nail down the Required/Inferred/Specified story ': 変数の種類と、その順番について
- Note [Required, Specified, and Inferred for types],
compiler/typecheck/TcTyClsDecls
, 型変数の種類について, 上記の Issues #15743 によるもの
- Note [Required, Specified, and Inferred for types],
-
Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility]:
compiler/types/TyCoRep.hs
, 変数の visiblility について
-
関連
-
原論文:
-
ghc-devs
:- "VisibleTypeApplication and AllowAmbiguousTypes": 上記論文で
AllowAmbiguousTypes
を自動的に有効にする旨の注釈が付記されているが、実際はそうなっていない理由に関わるスレッド
- "VisibleTypeApplication and AllowAmbiguousTypes": 上記論文で
-
ghc-wiki-mirror
-
"Visible Type Application", "古い" らしいので見ないかもしれません
Everything below here is the old wiki page. Much of it is relevant, but it needs curation. Richard will do that in due course.
-
-
ghc-proposals
-
Accepted
-
#26: "Explicit specificity in type variable binders": 推論させる型変数を明示的に記述するための記法
-
#31: "Type Applications in Patterns", 下記 request #291 にて継続して議論中の内容あり, 後日
-
#50: "Binding type variables in lambda-expressions, 下記 request #238 にて一部修正と新規の言語拡張追加に関する議論あり
-
-
request:
-
#218: "-XApplyingVia: 対象外
- 参考: Note [Newtype-deriving instances]:
compiler/typecheck/TcGenDeriv
, GND/DerivingVia が内部で行なっていることについて
- 参考: Note [Newtype-deriving instances]:
-
#238: Introduce -XTypeAbstractions, limiting -XScopedTypeVariables: 上掲 #50: "Binding type variables in lambda-expressions の一部修正と追加の言語拡張の提案
- Note [hsScopedTvs vis_flag]:
compiler/GHC/Hs/Types.hs
- Note [hsScopedTvs vis_flag]:
-
#291: "Simplify scoping for type applications in patterns", 上掲 #31 "Type Applications in Patterns" の merge 後に継続して議論中, 対象外
-
-
-
ghc
- Issues:
label: TypeApplications
- Issues:
注意事項
内容について
- 主催者は Type applications に関する内容に 精通しているわけではありません
- "GHC User's Guide" などにおいて、「目的」欄に記述していない言語拡張に関して言及されていることがあります。それらの言語拡張について後に取扱うことを予定している場合は、その 言語拡張に関連する内容は流し読み します。
進め方について
- 毎回模範的に準備して進めるつもりはありません。読みながら内容を理解していくというスタンスです。
- 模範的なプランがあり、それに基づいて進行するわけではありません (場当たり的になると思います)
- 切りが良いと判断した場合は、早めに終える ことがあります。 切りが悪いと判断した場合は、切りが良いと判断できるところに到達するまで 延長 することがあります。
日時
-
毎週金曜日 22:00 ~ 23:30
-
取扱う内容や範囲次第により、年越し後も継続します
注意事項
※ 掲載タイミングや更新頻度によっては、情報提供元ページの内容と差異が発生しますので予めご了承ください。
※ 最新情報の確認や参加申込手続き、イベントに関するお問い合わせ等は情報提供元ページにてお願いします。