Commit Graph

21 Commits

Author SHA1 Message Date
MaiaVictor
12706e3a9a Replace syntax 2021-11-10 01:56:05 -03:00
MaiaVictor
51d47a726f Allow for to be on the left side of a list comprehension 2021-11-05 21:12:45 -03:00
MaiaVictor
417a3f6f0d Mapped list comprehension 2021-11-05 21:06:36 -03:00
MaiaVictor
7e51441192 Implicit arguments 2021-10-17 20:20:41 -03:00
MaiaVictor
daf9083c64 Several improvements on the getter/setter syntax; see CHANGELOG 2021-10-17 13:18:57 -03:00
Rheidner
c4e290adc0 Kind: change version and CHANGELOG.md 2021-08-16 14:24:46 -03:00
Rheidner
f892c53b26 optimize for in maps 2021-07-07 13:27:20 -03:00
MaiaVictor
9b250ea523 Add Scheme compilation options to CLI 2021-07-02 15:50:00 -03:00
MaiaVictor
eee5af3688 IO UDP socket primitives
Check Example.udp.sender and Example.udp.receiver
2021-06-29 12:22:52 -03:00
MaiaVictor
53e921942b Fix changelog 2021-06-29 00:28:02 -03:00
MaiaVictor
4e4eee44bf Improve abort syntax 2021-06-29 00:25:54 -03:00
MaiaVictor
87f755308f New syntaxes
- Use

        use x = obj
        rest

        // Equivalent to:

        let x = obj
        open x
        rest

    - May

        may x = obj abort k
        rest

        // Equivalent to:

        case obj as x {
          none: k
          some:
            let x = x.value
            rest
        }

    - List comprehension

        [x * 10 for x in [1, 2, 3]]

        // Returns:

        [10, 20, 30]

    - Map for-in:

        for key,val in map with state:
          loop
        rest

        let state = for key:val in map:
          loop
        rest

    - Function composition:

        f . g

        // Equivalent to:

        Function.comp!!!(f, g)
2021-06-29 00:03:40 -03:00
MaisaMilena
e3be707e53
Update CHANGELOG.md
Invert logs order to show the most recent first
2021-06-12 22:40:42 -03:00
MaiaVictor
b5cc91a415 Monadic block improvements. Fixes #210 2021-06-12 18:32:21 -03:00
MaiaVictor
3b4d444f09 Kind 1.0.63
Generic derivers: stringifier, parser, serializer, deserializer. Example:

```
type MyType {
  foo(n: List<Nat>, s: String, m: MyType)
  bar
} deriving (stringifier, parser, serializer, deserializer)

Test: _
  IO {
    let val = MyType.foo([1,2,3], "Hello", MyType.bar)

    // Converts to string
    let str = Stringifier.run!(MyType.stringifier, val)
    IO.print("str: " | str)

    // Parses string to a value
    let val = Parser.run!(MyType.parser, str) <> MyType.bar

    // Serializes to bits
    let bts = Serializer.run!(MyType.serializer, val)
    IO.print("bts: " | Bits.show(bts))

    // Deserializes to a value
    let val = Deserializer.run!(MyType.deserializer, bts) <> MyType.bar

    // Converts to string again
    let str = Stringifier.run!(MyType.stringifier, val)
    IO.print("str: " | str)
  }
```
2021-06-12 17:32:04 -03:00
MaiaVictor
af7aceed8f Bugfixes: cmp literals and Nat/Chr/Str must require their deps 2021-05-08 19:05:44 -03:00
MaiaVictor
98cb7f1869 Improve operator inference 2021-05-08 18:16:10 -03:00
MaiaVictor
8c0d7f8b78 Better num lits and ops; cache uses lowcase files 2021-05-08 18:01:27 -03:00
MaiaVictor
7c5170fc6d Float literal bugfix 2021-05-08 10:07:22 -03:00
MaiaVictor
96fcda410a Update CHANGELOG 2021-05-08 02:33:31 -03:00
MaiaVictor
5dbcecece4 Record new/get/set syntax 2021-05-08 01:54:21 -03:00