Skip to content

0.9.4

Choose a tag to compare

@github-actions github-actions released this 01 Jul 02:13
· 1117 commits to master since this release
14a3ad4
  • motoko (moc)

    • Allow multiline text literals (#3995).
      For example,

      "A horse walks into a bar.
      The barman says: `Why the long face?`"
      

      parses as:

      "A horse walks into a bar.\nThe barman says: `Why the long face?`"
      
    • Added pipe operator <exp1> |> <exp2> and placeholder expression _ (#3987).
      For example:

      Iter.range(0, 10) |>
        Iter.toList _ |>
          List.filter<Nat>(_, func n { n % 3 == 0 }) |>
            { multiples = _ };

      may, according to taste, be a more readable rendition of:

      { multiples =
         List.filter<Nat>(
           Iter.toList(Iter.range(0, 10)),
             func n { n % 3 == 0 }) };

      However, beware the change of evaluation order for code with side-effects.

    • BREAKING CHANGE (Minor):

      New keyword composite allows one to declare Internet Computer composite queries (#4003).

      For example,

      public shared composite query func sum(counters : [Counter]) : async Nat {
        var sum = 0;
        for (counter in counters.vals())  {
          sum += await counter.peek();
        };
        sum
      }

      has type:

      shared composite query [Counter] -> async Nat

      and can call both query and other composite query functions.

      See the documentation for full details.

    • Allow canister imports of Candid service constructors, ignoring the service arguments to
      import the instantiated service instead (with a warning) (#4041).

    • Allow optional terminal semicolons in Candid imports (#4042).

    • bugfix: allow signed float literals as static expressions in modules (#4063).

    • bugfix: improved reporting of patterns with record types in error messages (#4002).

  • motoko-base