GitBook: [main] 20 pages modified

This commit is contained in:
folex 2021-06-25 11:25:44 +00:00 committed by gitbook-bot
parent 8e88aa8ef1
commit 4647d7bb68
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
4 changed files with 14 additions and 28 deletions

View File

@ -6,9 +6,3 @@
* container
* VSCode extension\(s\)

View File

@ -5,9 +5,5 @@
* functional
* theoretical foundation
see start: [https://hackmd.io/@k0-nEQfXQsuo0LE3OblOjg/HJ1DoCdIu](https://hackmd.io/@k0-nEQfXQsuo0LE3OblOjg/HJ1DoCdIu)

View File

@ -1,6 +1,6 @@
# Types
### Scalars
## Scalars
Scalar types follow the Wasm IT notation.
@ -12,24 +12,24 @@ Scalar types follow the Wasm IT notation.
* Records \(product type\): see below
* Arrays: see Collection Types below
### Literals
## Literals
You can pass booleans \(true, false\), numbers, double-quoted strings as literals.
### Products
## Products
```python
data ProductName:
field_name: string
data OtherProduct:
prod: ProductName
flag: bool
flag: bool
```
Fields are accessible with the `.` operator, e.g. `product.field`.
### Collection Types
## Collection Types
Aqua has three different types with variable length, denoted by quantifiers `[]`, `*`, and `?`.
@ -41,7 +41,7 @@ Appendable collection with 0..N values: `*`
You can access a distinct value of a collection with `!` operator, optionally followed by an index.
### Arrow Types
## Arrow Types
Every function has an arrow type that maps a list of input types to an optional output type.
@ -63,7 +63,7 @@ arrow()
x <- arrow()
```
### Type Alias
## Type Alias
For convinience, you can alias a type:
@ -71,7 +71,7 @@ For convinience, you can alias a type:
alias MyAlias = ?string
```
### Type Variance
## Type Variance
Aqua is made for composing data on the open network. That means that you want to compose things if they do compose, even if you don't control its source code.
@ -79,11 +79,9 @@ Therefore Aqua follows the structural typing paradigm: if a type contains all th
For arrow types, Aqua checks variance on arguments, contravariance on the return type.
### Type of a Service and a file
## Type of a Service and a file
A service type is a product of arrows. File is a product of all defined constants and functions \(treated as arrows\). Type definitions in the file does not go to the file type.
{% embed url="https://github.com/fluencelabs/aqua/blob/main/types/src/main/scala/aqua/types/Type.scala" caption="See the types system implementation" %}

View File

@ -8,7 +8,7 @@
* chain-forward pattern
* Note on Marine, Wasm IT
Given an abundance of active and abandoned programming languages, why create another one ? The need for Aqua arises from the desire to maximize the potential afforded by peer-to-peer networks as a distributed hosting environment for services composable into applications and backends.
Given an abundance of active and abandoned programming languages, why create another one ? The need for Aqua arises from the desire to maximize the potential afforded by peer-to-peer networks as a distributed hosting environment for services composable into applications and backends.
Figure x: need one new graphic to illustrate both aspects
@ -19,11 +19,11 @@ That is, Aqua provides the capabilities necessary to implement and execute a "fu
* Programmable network requests
* Extensible beyond peer-native services to Web2 resources
At the heart of the peer-to-peer programming model -- is this Fluence or Aquamarine ?
At the heart of the peer-to-peer programming model -- is this Fluence or Aquamarine ?
* _particle_
* _particle_
### A Taste Of Aqua
## A Taste Of Aqua
or a different example?
@ -38,5 +38,3 @@ func greeter(name: string, greet: bool, node: string, service_id: string) -> str
<- res
```