Skip to content
Permalink
Browse files

added checklist and minor typos.

  • Loading branch information...
simonjohnthompson committed Apr 13, 2019
1 parent e2ea4a6 commit d3ca2d6f5920a1a47de9c5923ded4e48613ccd6a
Showing with 56 additions and 8 deletions.
  1. +9 −7 docs/README.md
  2. +46 −0 docs/tutorial-v1.3/checklist.md
  3. +1 −1 docs/tutorial-v1.3/differences.md
@@ -15,25 +15,27 @@ Meadow is also available in two versions:

## Where should I start?

_I want to learn the ideas behind Marlowe, but not to write Marlowe contracts myself._
I want to learn the ideas behind Marlowe, but not to write Marlowe contracts myself.

* The first parts of the tutorial, [link](./tutorial-v1.3/README.md), and the Udemy course, [link](https://www.udemy.com/marlowe-programming-language/), will give you this introduction.
* The first parts of the tutorial, [link](./tutorial-v1.3/README.md), and the Udemy course, [link](https://www.udemy.com/marlowe-programming-language/), will give you this introduction.

_I want to learn how to write simple Marlowe contracts, and to run them in the Meadow tool_
I want to learn how to write simple Marlowe contracts, and to run them in the Meadow tool.

* The Udemy course, [link](https://www.udemy.com/marlowe-programming-language/), and tutorial, [link](./tutorial-v1.3/README.md), will give you an introduction to building contracts using Blockly.
* If you are not a Haskell programmer, then you can skip the tutorial sections on Understanding the semantics and Using Marlowe.
* The Udemy course, [link](https://www.udemy.com/marlowe-programming-language/), and tutorial, [link](./tutorial-v1.3/README.md), will give you an introduction to building contracts using Blockly.
* If you are not a Haskell programmer, then you can skip the tutorial sections on [Understanding the semantics](./tutorial-v1.3/marlowe-semantics.md) and [Using Marlowe](./tutorial-v1.3/using-marlowe.md).

_I have learned about Marlowe 1.3, and written contracts there, but I want to convert to v2.0 use Meadow in the cloud._
I have learned about Marlowe 1.3, and written contracts there, but I want to convert to v2.0 use Meadow in the cloud.

* You can find out about the differences in v1.3 and v2.0 [here](./tutorial-v1.3/differences.md), and this checklist, [link](./tutorial-v1.3/checklist.md), will help you to convert contracts from v1.3 to v2.0.

_I am a Haskell programmer, and I want to get started developing Marlowe contracts embedded in Haskell and to run them in Haskell and Meadow._
I am a Haskell programmer, and I want to get started developing Marlowe contracts embedded in Haskell and to run them in Haskell and Meadow.

* To do this, follow the tutorial on the current version of Marlowe, [link](./tutorial-v2.0/README.md), and develop your programs in Meadow in the cloud, [link](https://prod.meadow.marlowe.iohkdev.io).

## Materials available

This section lists all the learning resources for Marlowe and Meadow.

* Tutorial for version 1.3 of Marlowe and the first version of the Meadow tool. [Link](./tutorial-v1.3/README.md)
* Tutorial for version 2.0 of Marlowe and Meadow in the cloud. [Link](./tutorial-v2.0/README.md)
* An overview of the differences between v1.3 and v2.0. [Link](./tutorial-v1.3/differences.md)
@@ -0,0 +1,46 @@
# Converting Marlowe contracts from v1.3 to v2.0

The [overview](./differences.md) describes the differences between Marlowe 2.0 and Marlowe 1.3; here that information is presented as a checklist for converting contracts between v1.3 and v2.0.

## Checklist

1. `CommitCash` expressions in `Contract`:

Rename the constructor to `Commit`.

An _action id_ field needs to be added as the first field of the constructor. As long as it is unique within the contract, the particular value is not relevant to the behaviour of the contract, but is used in constructing inputs, e.g. in Meadow.

The constructor `ConstMoney` of type `Money` should be replaced by `Constant` of type `Value`.

1. `Pay` constructs in `Contract`:

An _action id_ field needs to replace the payment id as the first field of the constructor. Note that this must be unique within the contract.

The `Person` making the contract is no longer a field; this is replaced by the `IdCommit` of the commitment from which the payment is to be made.

Payments originally had a single continuation `Contract`, irrespective of whether or not the construct had timed out. This is now distinguished, and so the original continuation should be duplicated.

The constructor `ConstMoney` and `AvailableMoney` of type `Money` should be replaced by `Constant` and `Committed` of type `Value`.

1. `Redeem` expressions in `Contract`:

The `Redeem` constructor has been removed, and it should be replaced by a `Pay` constructor. This will be a payment from the commitment to the person who made the commitment initially.

More details of how to construct payments in v2.0 are given in the previous item, but note that the extra information required will include an action id, a timeout, and a continuation to use if the timeout is exceeded.

1. `When` and `Choice` contracts.

These are not changed at the top level, but `Observation` values within them are changed. In particular, choices are structured in a different way as described in the [overview document](./differences.md).

For example, the construct
`PersonChoseThis … per c`
becomes
`ChoseThis (idCH, per) c`
where `idCH` identifies the choice.

## Where to go to find out more

- Here are tutorials on [Marlowe v1.3](./README.md) and [Marlowe v2.0](../tutorial-v2.0/README.md), and [Meadow in the cloud](https://prod.meadow.marlowe.iohkdev.io).

- The semantics of Marlowe 2.0 can be found [here](https://github.com/input-output-hk/marlowe/blob/v1.3/src/Semantics.hs).

@@ -2,7 +2,7 @@

Marlowe 2.0 is a thorough revision of Marlowe 1.3 semantics that tries to simplify existing aspects of Marlowe, to include additional functionality, and to give more intuitive behaviour when executing contracts.

At the time of writing, Marlowe 2.0 is in the late stages of development but it has not reached the maturity nor the tool support of Marlowe 1.3. For these reasons, the tutorial so far has focused on Marlowe 1.3, but also has a version based on 2.0.
At the time of writing, Marlowe 2.0 is in the late stages of development but it has not reached the maturity nor the tool support of Marlowe 1.3. For these reasons, the tutorial so far has focused on Marlowe 1.3, but there is also [a version based on 2.0](../tutorial-v2.0/README.md).

This tutorial aims to make it easier for users familiar with Marlowe 1.3 to transition to Marlowe 2.0, but it should not be considered as an exhaustive description of the differences between the two versions.

0 comments on commit d3ca2d6

Please sign in to comment.
You can’t perform that action at this time.