2,619
次編輯
Tankianting(討論 | 貢獻) |
Tankianting(討論 | 貢獻) |
||
行 173: | 行 173: | ||
|Zero | |Zero | ||
|Suc of nat</pre> | |Suc of nat</pre> | ||
====抽象化描述==== | ====抽象化描述==== | ||
因為排版 | 因為排版 | ||
行 213: | 行 195: | ||
推論:<math>\forall X, s.t. F(X)\subseteq X \rightarrow fix(F)\subseteq X</math><math></math> | 推論:<math>\forall X, s.t. F(X)\subseteq X \rightarrow fix(F)\subseteq X</math><math></math> | ||
====例外處理:Option type and exception==== | |||
處理例外的方式 | |||
Option type | |||
<pre>type 'a option = | |||
| Some of 'a | |||
| None | |||
</pre> | |||
exception | |||
<pre>let hd l = | |||
match l with | |||
| x::l -> x | |||
| [] -> raise Not_found</pre> | |||
搭配 | |||
<pre>try | |||
... | |||
with | |||
| Not_found -> ...</pre> | |||
[[分類:資訊]] | [[分類:資訊]] | ||
[[分類:邏輯學]] | [[分類:邏輯學]] |