mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 21:01:10 +00:00
Update hash
This commit is contained in:
parent
ddcbe9859e
commit
d1fc1eb0ca
15 changed files with 28 additions and 28 deletions
4
doc/JA/API/modules/external/alstruct.md
vendored
4
doc/JA/API/modules/external/alstruct.md
vendored
|
@ -1,6 +1,6 @@
|
|||
# alstruct
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/API/modules/external/alstruct.md&commit_hash=06f8edc9e2c0cee34f6396fd7c64ec834ffb5352)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/API/modules/external/alstruct.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
代数的構造を表すトレイトや、それにかかるパッチを提供するモジュール。
|
||||
|
||||
|
@ -25,7 +25,7 @@ assert Nat.ReturnTypeof(Div) == Positive Ratio
|
|||
```python
|
||||
SemiGroup Op: Kind 2 = Op(Self, Self)
|
||||
|
||||
IntIsSemiGroupAdd = Patch Int, Impl=SemiGroup Add
|
||||
IntIsSemiGroupAdd = Patch Int, Impl := SemiGroup Add
|
||||
|
||||
Int <: SemiGroup Add
|
||||
```
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# イテレータ
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/16_iterator.md&commit_hash=51de3c9d5a9074241f55c043b9951b384836b258)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/16_iterator.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
イテレータは、コンテナの要素を取り出すためのオブジェクトです。
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# トレイト
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/03_trait.md&commit_hash=51de3c9d5a9074241f55c043b9951b384836b258)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/03_trait.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
トレイトは、レコード型に型属性の要求を追加した記名型です。
|
||||
Pythonでいう抽象基底クラス(Abstract Base Class, ABC)に類似しますが、代数的演算を行えるという特徴があります。
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# 型変数(Type Variable)、量化型
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/15_quantified.md&commit_hash=51de3c9d5a9074241f55c043b9951b384836b258)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/15_quantified.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
型変数はサブルーチン引数の型指定などに使用する変数で、その型が任意である(単相化しない)ことを示します。
|
||||
まず、型変数を導入するモチベーションとして、入力をそのまま返す`id`関数について考えましょう。
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# カインド(Kind)
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/advanced/kind.md&commit_hash=06f8edc9e2c0cee34f6396fd7c64ec834ffb5352)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/advanced/kind.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
Ergでは全てが型付けられている。型自体も例外ではない。「型の型」を表すのが __カインド(種)__ である。例えば`1`が`Int`に属しているように、`Int`は`Type`に属している。`Type`は最もシンプルなカインドである __原子カインド(Atomic kind)__ である。型理論的の記法では、`Type`は`*`に対応する。
|
||||
|
||||
|
|
12
doc/zh_CN/API/modules/external/alstruct.md
vendored
12
doc/zh_CN/API/modules/external/alstruct.md
vendored
|
@ -1,12 +1,12 @@
|
|||
# 结构
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/API/modules/external/alstruct.md&commit_hash=06f8edc9e2c0cee34f6396fd7c64ec834ffb5352)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/API/modules/external/alstruct.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
模块为它们提供代表代数结构和补丁的特征
|
||||
|
||||
* 成员
|
||||
|
||||
## 二进制运算
|
||||
## BinOp(二进制运算)
|
||||
|
||||
```python
|
||||
BinOp Op: Kind 2 = Subsume Op(Self, Self.ReturnTypeOf Op), Additional: {
|
||||
|
@ -20,7 +20,7 @@ assert Nat. ReturnTypeof(Mul) == Nat
|
|||
assert Nat.ReturnTypeof(Div) == Positive Ratio
|
||||
```
|
||||
|
||||
## 半群(一个二元运算的代数系统)
|
||||
## SemiGroup(半群)
|
||||
|
||||
```python
|
||||
SemiGroup Op: Kind 2 = Op(Self, Self)
|
||||
|
@ -30,7 +30,7 @@ IntIsSemiGroupAdd = Patch Int, Impl=SemiGroupAdd
|
|||
Int <: SemiGroup Add
|
||||
```
|
||||
|
||||
## 函子
|
||||
## Functor(函子)
|
||||
|
||||
```python
|
||||
# * Identity law: x.map(id) == x
|
||||
|
@ -40,7 +40,7 @@ Functor = Trait {
|
|||
}
|
||||
```
|
||||
|
||||
## 应用
|
||||
## Applicative(应用)
|
||||
|
||||
```python
|
||||
# * Identity law: x.app(X.pure(id)) == x
|
||||
|
@ -50,7 +50,7 @@ Applicative = Subsume Functor, Additional: {
|
|||
}
|
||||
```
|
||||
|
||||
## 单子(交互式命令行工具以及面向对象的脚本技术)
|
||||
## Monad(单子)
|
||||
|
||||
```python
|
||||
Monad = Subsume Applicative, Additional: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# 迭代器
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/16_iterator.md&commit_hash=51de3c9d5a9074241f55c043b9951b384836b258)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/16_iterator.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
迭代器是用于检索容器元素的对象。
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# 特质
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/03_trait.md&commit_hash=51de3c9d5a9074241f55c043b9951b384836b258)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/03_trait.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
Trait 是一种名义类型,它将类型属性要求添加到记录类型。
|
||||
它类似于 Python 中的抽象基类 (ABC),但区别在于能够执行代数运算。
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# 类型变量,量化类型
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/15_quantified.md&commit_hash=51de3c9d5a9074241f55c043b9951b384836b258)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/15_quantified.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
类型变量是用于例如指定子程序参数类型的变量,它的类型是任意的(不是单态的)。
|
||||
首先,作为引入类型变量的动机,考虑 `id` 函数,它按原样返回输入。
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Kind
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/advanced/kind.md&commit_hash=06f8edc9e2c0cee34f6396fd7c64ec834ffb5352)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/advanced/kind.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
一切都在 Erg 中输入。类型本身也不例外。 __kind__ 表示“类型的类型”。例如,`Int` 属于 `Type`,就像 `1` 属于 `Int`。 `Type` 是最简单的一种,__atomic kind__。在类型论符号中,`Type` 对应于 `*`。
|
||||
|
||||
|
|
12
doc/zh_TW/API/modules/external/alstruct.md
vendored
12
doc/zh_TW/API/modules/external/alstruct.md
vendored
|
@ -1,12 +1,12 @@
|
|||
# 結構
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/API/modules/external/alstruct.md&commit_hash=06f8edc9e2c0cee34f6396fd7c64ec834ffb5352)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/API/modules/external/alstruct.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
模塊為它們提供代表代數結構和補丁的特征
|
||||
|
||||
* 成員
|
||||
|
||||
## 二進制運算
|
||||
## 二進制運算(BinOp)
|
||||
|
||||
```python
|
||||
BinOp Op: Kind 2 = Subsume Op(Self, Self.ReturnTypeOf Op), Additional: {
|
||||
|
@ -20,7 +20,7 @@ assert Nat. ReturnTypeof(Mul) == Nat
|
|||
assert Nat.ReturnTypeof(Div) == Positive Ratio
|
||||
```
|
||||
|
||||
## 半群(一個二元運算的代數系統)
|
||||
## 半群(SemiGroup)
|
||||
|
||||
```python
|
||||
SemiGroup Op: Kind 2 = Op(Self, Self)
|
||||
|
@ -30,7 +30,7 @@ IntIsSemiGroupAdd = Patch Int, Impl=SemiGroupAdd
|
|||
Int <: SemiGroup Add
|
||||
```
|
||||
|
||||
## 函子
|
||||
## 函子(Functor)
|
||||
|
||||
```python
|
||||
# * Identity law: x.map(id) == x
|
||||
|
@ -40,7 +40,7 @@ Functor = Trait {
|
|||
}
|
||||
```
|
||||
|
||||
## 應用
|
||||
## 應用(Applicative)
|
||||
|
||||
```python
|
||||
# * Identity law: x.app(X.pure(id)) == x
|
||||
|
@ -50,7 +50,7 @@ Applicative = Subsume Functor, Additional: {
|
|||
}
|
||||
```
|
||||
|
||||
## 單子(交互式命令行工具以及面向對象的腳本技術)
|
||||
## 單子(Monad)
|
||||
|
||||
```python
|
||||
Monad = Subsume Applicative, Additional: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# 迭代器
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/16_iterator.md&commit_hash=51de3c9d5a9074241f55c043b9951b384836b258)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/16_iterator.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
迭代器是用于檢索容器元素的對象。
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# 特質
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/03_trait.md&commit_hash=51de3c9d5a9074241f55c043b9951b384836b258)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/03_trait.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
Trait 是一種名義類型,它將類型屬性要求添加到記錄類型。
|
||||
它類似于 Python 中的抽象基類 (ABC),但區別在于能夠執行代數運算。
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# 類型變量,量化類型
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/15_quantified.md&commit_hash=51de3c9d5a9074241f55c043b9951b384836b258)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/15_quantified.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
類型變量是用于例如指定子程序參數類型的變量,它的類型是任意的(不是單態的)。
|
||||
首先,作為引入類型變量的動機,考慮 `id` 函數,它按原樣返回輸入。
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Kind
|
||||
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/advanced/kind.md&commit_hash=06f8edc9e2c0cee34f6396fd7c64ec834ffb5352)
|
||||
[](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=doc/EN/syntax/type/advanced/kind.md&commit_hash=14657486719a134f494e107774ac8f9d5a63f083)
|
||||
|
||||
一切都在 Erg 中輸入。類型本身也不例外。 __kind__ 表示“類型的類型”。例如,`Int` 屬于 `Type`,就像 `1` 屬于 `Int`。 `Type` 是最簡單的一種,__atomic kind__。在類型論符號中,`Type` 對應于 `*`。
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue