fix "types.md"
This commit is contained in:
parent
afa61e5825
commit
3d925ae43e
@ -59,12 +59,12 @@ let ledger: account_balances = Map.literal
|
||||
|
||||
<!--ReasonLIGO-->
|
||||
```reasonligo
|
||||
/* account_balances is a simple type, a map of address <-> tez */
|
||||
(* account_balances is a simple type, a map of address <-> tez *)
|
||||
type account_balances = map(address, tez);
|
||||
|
||||
let ledger: account_balances =
|
||||
Map.literal([
|
||||
("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address, 10mutez),
|
||||
("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address, 10mutez)
|
||||
]);
|
||||
```
|
||||
|
||||
@ -124,25 +124,23 @@ let ledger: account_balances = Map.literal
|
||||
|
||||
<!--ReasonLIGO-->
|
||||
```reasonligo
|
||||
/* alias two types */
|
||||
(* alias two types *)
|
||||
type account = address;
|
||||
type number_of_transactions = nat;
|
||||
/* account_data consists of a record with two fields (balance, number_of_transactions) */
|
||||
(* account_data consists of a record with two fields (balance, number_of_transactions) *)
|
||||
type account_data = {
|
||||
balance: tez,
|
||||
number_of_transactions,
|
||||
};
|
||||
/* our ledger / account_balances is a map of account <-> account_data */
|
||||
(* our ledger / account_balances is a map of account <-> account_data *)
|
||||
type account_balances = map(account, account_data);
|
||||
|
||||
/* pseudo-JSON representation of our map */
|
||||
/* {"tz1...": {balance: 10mutez, number_of_transactions: 5n}} */
|
||||
(* pseudo-JSON representation of our map
|
||||
{"tz1...": {balance: 10mutez, number_of_transactions: 5n}} *)
|
||||
let ledger: account_balances =
|
||||
Map.literal([
|
||||
(
|
||||
"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address,
|
||||
{balance: 10mutez, number_of_transactions: 5n},
|
||||
),
|
||||
("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address,
|
||||
{balance: 10mutez, number_of_transactions: 5n})
|
||||
]);
|
||||
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user