1. 19 Jun, 2020 2 commits
    • Pinto Pasquale's avatar
      [TM-410] make Indigo's tutorial a buildable website · 9f3d3d66
      Pinto Pasquale authored
      Problem: we can use the existing tutorial to make a static website
      for Indigo using mkdocs.
      This needs changed in the documentation's content, namely:
      - we would like to statically include part of the example modules
      - there needs to be an index/home page
      - the appendices should be moved to be "reference" pages
      - the explanations should not be flat, but include note blocks, etc.
      - references to local files need to be removed, as they don't work
      
      Solution: Make a buildable website with:
      - configuration for mkdocs and its extension
      - CSS for customized styling
      - a python-markdown extension for example source code inclusion
      9f3d3d66
    • Pinto Pasquale's avatar
      [TM-410] re-arrange indigo tutorial's files for website building · 1145fb98
      Pinto Pasquale authored
      Problem: A website for Indigo needs to be built from its current
      tutorial, however the tree structure is not ideal, in particular:
      - markdown files for the chapters are organized alonside the source
        code for the examples
      - the example modules are tied to the documentation structure
      These constitute a problem because we want the documentation's file
      tree structure to be independent from the examples and vice-versa.
      
      Solution: move the markdown files in a flat new directory and move
      the example modules in a topic-based tree structure.
      1145fb98
  2. 15 Jun, 2020 1 commit
    • Anton Myasnikov's avatar
      [#177] Make 'contractCallingUnsafe' easier to use · 55505f3a
      Anton Myasnikov authored
      Problem: Currently `contractCallingUnsafe` uses `EpName` for its
      argument which possesses a problem for a beginners to properly use.
      
      Solution: Define `buildEpName` and `unsafeBuildEpName` functions and
      update the tutorial.
      55505f3a
  3. 09 Jun, 2020 2 commits
    • Pinto Pasquale's avatar
      [#124] revise Indigo operators · 8a5a2539
      Pinto Pasquale authored
      Problem: some operators in Indigo are named in an odd way (usually with
      a `.`) to avoid conflicts with Haskell operators, additionally many of
      them operating on structures have been added organically and do not
      follow any convention, being confusing.
      Moreover, many of them do not have a prefix counterpart, which may be
      useful to have available.
      
      Solution: rename operators, replacing the ones from Prelude in case of
      name clashing and based on a convention in case of structure-based.
      Addionally, add all necessary prefix counterpart using the names of
      Michelson instructions where one exists.
      8a5a2539
    • Moremi Vannak's avatar
      [#221] Use mixins instead of base-noprelude · 07210557
      Moremi Vannak authored
      Problem: We are using `base-noprelude` dependency which is not a
      standard package. We can use `base` instead and just hide its
      `Prelude` module using `mixins` feature of Cabal. The advantage is
      that we will have less dependencies.
      
      Solution: Remove `base-noprelude`, use `base` with mixin `hiding
      Prelude` instead.
      07210557
  4. 03 Jun, 2020 4 commits
  5. 01 Jun, 2020 2 commits
  6. 30 May, 2020 1 commit
    • Maxim Koltsov's avatar
      [TM-62] Do address computation more correctly · 70388829
      Maxim Koltsov authored
      Problem: currently the address of any originated contract is calculated,
      essentially, as a hash of its JSON-encoded code and initial storage.
      This means that multiple originations of the same contract lead to the
      identical addresses, contrary to what reference Tezos does.
      
      Solution: include a global operation counter and in-operation
      origination nonce to the calculation of the addresses. Match Tezos's
      encoding of addresses more closely, namely dervive addresses from any
      global operation that led to origination, not the immediate
      OriginationOperation.
      70388829
  7. 25 May, 2020 1 commit
  8. 22 May, 2020 2 commits
    • Moremi Vannak's avatar
      [#217] - Add `nonZero` to Indigo expression · 825f6432
      Moremi Vannak authored
      Problem:  We have `nonZero` in Lorentz that returns Nothing if the
      value is `0`, and `Just` the value otherwise.
      There is however no equivalent to it in Indigo.
      
      Solution: Add `nonZero` expression equivalent to its Lorentz homonym
      825f6432
    • Moremi Vannak's avatar
      [#138] Reduce the usage `$` in Indigo · 89ae9d78
      Moremi Vannak authored
      Problem: Indigo code often contains the `$` Haskell operator,
      however since the language is meant to be used by people not
      familiar with Haskell it would be great to not make it a necessity.
      
      Solution: Reduce usage of `$` in 2 places:
      
      1. right before `do` is used for a block code
      - Solved by using `BlockArguments`
      
      2. right after `new`
      - Solved by treating `new$` as one keyword
      89ae9d78
  9. 21 May, 2020 3 commits
    • Moremi Vannak's avatar
      [#175] Remove TODO related to `xor` · 0f7ebb99
      Moremi Vannak authored
      Problem: There is a TODO comment related to `xor` issue that is not removed.
      
      Solution: Remove the TODO comment.
      0f7ebb99
    • Moremi Vannak's avatar
      [#176] Rename `concat'` expression in Indigo · bff9757b
      Moremi Vannak authored
      Problem: Indigo has a `concat` expression to concat 2 values and
      `concat'` to concatenate a list of values. We want to keep `concat`
      since it has an equivalent to Michelson's `CONCAT`. However,
      `concat'` can be confusing, it is better to rename this.
      
      Solution: Rename `concat'` to `concatAll`
      bff9757b
    • Moremi Vannak's avatar
      [#204] Fix the Indigo tutorial REPL command · 6cc9ddec
      Moremi Vannak authored
      Problem: Current `stack ghci indigo` causes ambiguous error
      `Ambiguous occurrence ‘>>=’ `. A workaround is to load the file
      directly `stack ghci code/indigo/src/Indigo.hs`, but that is not ideal.
      
      Solution: By using stack target syntax, we can add an executable
      component inside indigo, and only load that executable via `stack
      ghci :indigo-repl`.
      6cc9ddec
  10. 20 May, 2020 2 commits
  11. 19 May, 2020 3 commits
    • Ivan Gromakovskii's avatar
      Require cabal-version to be 2.2 · 6be834a4
      Ivan Gromakovskii authored
      Problem: somehow hpack decided to set `cabal-version` to 2.0 and
      now `indigo` fails the check for common mistakes:
      ```
      Package check reported the following errors:
      The package uses RebindableSyntax with OverloadedStrings or
      OverloadedLists in default-extensions, and also Paths_ autogen module.
      That configuration is known to cause compile failures with Cabal < 2.2.
      To use these default-extensions with Paths_ autogen module specify at
      least 'cabal-version: 2.2'.
      ```
      
      Solution: in order to avoid such errors we explicitly require
      cabal-version to be 2.2.
      6be834a4
    • Ivan Gromakovskii's avatar
      Update license information in Haskell packages · 9754db3a
      Ivan Gromakovskii authored
      Problem: we recently updated license that applies to all files.
      Now it's MIT. But Haskell packages still say it's AGPL.
      Solution: update `LICENSE` files and `license` fields.
      9754db3a
    • Ivan Gromakovskii's avatar
      Fix some broken/obsolete links · 9680cdfb
      Ivan Gromakovskii authored
      Problem: recently gitlab changed the way URLs are formed, specifically:
      1. There is `/-/` in many URLs such as
      https://gitlab.com/morley-framework/morley/-/issues.
      2. Because of that some relative links like `../blob/foo` are broken.
      3. And of course many links are a bit obsolete because they get
      redirected.
      
      Solution:
      1. Apparently now we can use saner links in MR templates, e. g.
      just `README.md` instead of `../blob/master/README.md`. So we do it.
      2. Obsolete links are updated to include this `/-` thing.
      9680cdfb
  12. 18 May, 2020 1 commit
    • Maxim Koltsov's avatar
      [#152] Documentation for ADT constructors & fields · c2845ede
      Maxim Koltsov authored
      Problem: it is not always clear what constructors and/or fields of ADTs
      used in contract mean, but there is now way to document them except of
      using `typeDocMdDescription`, which is not checked by the compiler.
      
      Solution: add type-level descriptions for constructors and fields.
      Demand that those descriptions are attached only to existing
      constructors and fields, via a type family.
      c2845ede
  13. 15 May, 2020 1 commit
    • Kirill Elagin's avatar
      Add licensing information · 1776886c
      Kirill Elagin authored
      * Add licenses for everything
      * Almost everything is copyrighted by TQ and the license is MIT,
      * apart from some dot-files in the root (Unlicensed by Serokell)
      * and example contracts comming from Tezos.
      1776886c
  14. 13 May, 2020 1 commit
  15. 11 May, 2020 1 commit
    • Pinto Pasquale's avatar
      [#135] add custom Indigo fromInteger · 2afa4bb2
      Pinto Pasquale authored
      Problem: type signatures or annotations always need to be specified for
      numeric values in Indigo code, because they are otherwise ambiguous.
      However, Indigo uses `RebindableSyntax` that allows to define a
      `fromInteger` function used to resolve numeric literals, and this can
      be used to implement (some) custom resolution logic.
      
      Solution: implement a `fromInteger` that takes an additional value
      (beside the Integer) that provides disambiguation for the resulting
      value type, with function constructors for this type that match the
      target Michelson type.
      Additionally, because of this, the 'int' expression has been renamed
      'toInt'.
      2afa4bb2
  16. 08 May, 2020 2 commits
  17. 04 May, 2020 1 commit
    • Pinto Pasquale's avatar
      [#90] add appendix to Indigo tutorial · 44750f1e
      Pinto Pasquale authored
      Problem: The chapters of the Indigo tutorial refer to appendices that
      are empty regarding types and expressions.
      
      Solution: add content to both appendices (and complete the tutorial).
      44750f1e
  18. 01 May, 2020 2 commits
    • Anton Myasnikov's avatar
      [#182] Rename *Just and *Nothing to *Some and *None · 5710d3bf
      Anton Myasnikov authored
      Problem: In indigo we have expressions that refer to haskell `Maybe`
      types such as `ifJust` which is inconvient since we use constructors
      such as `some` and `none` that refer to Michelson types and so such
      occurences need to be renamed.
      
      Solution: Rename `ifJust` and `ifNothing` to `ifSome` and `ifNone`.
      5710d3bf
    • Ilya Peresadin's avatar
      [#151] Rewrite 'setVar', 'setField', and Expr.Decompose module. Decompose storage before run · c7faaa04
      Ilya Peresadin authored
      Problem: it's not possible to use newly written machinery
      in statements like 'setVar' and 'setField'.
      
      Solution: first of all we need to implement decomposition functionality:
      when we assign a var new value, this variable might be decomposed,
      so we need to decompose our value to and call 'setVar' recursively.
      This functionality is implemented in 'Expr.Decompose'.
      Secondly, before compile contract we need to fully decompose
      storage into cells, to have at least one decomposed variable to
      see the effect of implemented approach.
      c7faaa04
  19. 28 Apr, 2020 1 commit
    • Ilya Peresadin's avatar
      [#143] Define different types of lambda with single argument · 4909b41f
      Ilya Peresadin authored
      Problem: some lambas may modify storage, some may not,
      and depending on that the amount of code which is generated
      can be reduced.
      
      Solution: introduce three types of lambda with one argument:
      * pure lambdas (which don't modify neither storage nor operations)
      * regular lambas (which modify storage)
      * lambda with effects (which modify storage and operations)
      4909b41f
  20. 20 Apr, 2020 1 commit
    • Pinto Pasquale's avatar
      [90] improve docs of Indigo tutorial and the modules it references · 89be01f4
      Pinto Pasquale authored
      Problem: Indigo tutorial has not been fully checked since recent
      changes and there are some small mistakes, additionally the modules
      it references also have some imperfections in their docs.
      
      Solution: The tutorial was rechecked agaist the current implementation
      and the docs have been rephrased/adjusted.
      Additionally some code-style fixes have been made in these modules.
      89be01f4
  21. 17 Apr, 2020 1 commit
    • Ivan Gromakovskii's avatar
      [#165] Expand indigo-tutorial's description · 680df5e7
      Ivan Gromakovskii authored
      Problem: `cabal check` reports a warning for `indigo-tutorial`
      because its description is not longer than its synopsis.
      We don't really care about that because this package is only for
      CI, but for other packages we want `cabal check` to pass with no
      warnings and it's easier to fix `indigo-tutorial` than to ignore it.
      
      Solution: expand the description.
      680df5e7
  22. 14 Apr, 2020 1 commit
  23. 07 Apr, 2020 1 commit
    • Pinto Pasquale's avatar
      [#90] fix Indigo's tutorial package to make it buildable · ebbc1761
      Pinto Pasquale authored
      Problem: Indigo's tutorial does not actually build, because its
      example modules are not included in the cabal file.
      This was caused by the modules having thir name starting with a
      number instead of a capital letter.
      Additionally, recent updates have broken these modules so they
      would not compile anyway.
      
      Solution: rename modules to include them in the cabal file, fix what
      was broken by recent changes.
      ebbc1761
  24. 01 Apr, 2020 1 commit
  25. 19 Mar, 2020 1 commit
    • Pinto Pasquale's avatar
      [#90] update Indigo README and add a tutorial · 372c60c6
      Pinto Pasquale authored
      Problem: Indigo documentation is outdated and was written for internal
      use only. It would be better to have a newcomers-frienly tutorial that
      also introduces concepts for developers.
      
      Solution: create a tutorial with examples that is easy to follow and
      contains (updated) information from the old README.
      Provide then a simpler README that refers to the tutorial.
      Additionally, add printing and type synonyms that help Indigo usage.
      372c60c6