Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Nov 1, 2024
1 parent d9a5eec commit 7370e50
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# iNet JS

[ [Website](https://inet.run)
[ [Website](https://inet.xieyuheng.com)
| [iNet Cute](https://github.com/cicada-lang/inet-cute) ]

This is an implementation of [interaction nets](https://en.wikipedia.org/wiki/Interaction_nets).
Expand Down Expand Up @@ -29,7 +29,7 @@ inet-js help [name] # Display help for a command

### Nat

[ [Goto The Playground](https://inet.run/playground/dHlwZSBOYXQKCm5vZGUgemVybygKICAtLS0tLS0KICB2YWx1ZSE6IE5hdAopCgpub2RlIGFkZDEoCiAgcHJldjogTmF0CiAgLS0tLS0tLS0tLQogIHZhbHVlITogTmF0CikKCm5vZGUgYWRkKAogIHRhcmdldCE6IE5hdCwKICBhZGRlbmQ6IE5hdAogIC0tLS0tLS0tCiAgcmVzdWx0OiBOYXQKKQoKcnVsZSBhZGQodGFyZ2V0ISwgYWRkZW5kLCByZXN1bHQpIHplcm8odmFsdWUhKSB7CiAgQGNvbm5lY3QoYWRkZW5kLCByZXN1bHQpCn0KCnJ1bGUgYWRkKHRhcmdldCEsIGFkZGVuZCwgcmVzdWx0KSBhZGQxKHByZXYsIHZhbHVlISkgewogIGFkZDEoYWRkKHByZXYsIGFkZGVuZCksIHJlc3VsdCkKfQoKZnVuY3Rpb24gb25lKCk6IE5hdCB7CiAgcmV0dXJuIGFkZDEoemVybygpKQp9CgpmdW5jdGlvbiB0d28oKTogTmF0IHsKICByZXR1cm4gYWRkKG9uZSgpLCBvbmUoKSkKfQoKZnVuY3Rpb24gdGhyZWUoKTogTmF0IHsKICByZXR1cm4gYWRkKHR3bygpLCBvbmUoKSkKfQoKZnVuY3Rpb24gZm91cigpOiBOYXQgewogIHJldHVybiBhZGQodHdvKCksIHR3bygpKQp9CgovLyBURVNUCgpldmFsIEBpbnNwZWN0KEBydW4oYWRkKHR3bygpLCB0d28oKSkpKQpldmFsIEBpbnNwZWN0KGFkZCh0d28oKSwgdHdvKCkpKQ) ]
[ [Goto The Playground](https://inet.xieyuheng.com/playground/dHlwZSBOYXQKCm5vZGUgemVybygKICAtLS0tLS0KICB2YWx1ZSE6IE5hdAopCgpub2RlIGFkZDEoCiAgcHJldjogTmF0CiAgLS0tLS0tLS0tLQogIHZhbHVlITogTmF0CikKCm5vZGUgYWRkKAogIHRhcmdldCE6IE5hdCwKICBhZGRlbmQ6IE5hdAogIC0tLS0tLS0tCiAgcmVzdWx0OiBOYXQKKQoKcnVsZSBhZGQodGFyZ2V0ISwgYWRkZW5kLCByZXN1bHQpIHplcm8odmFsdWUhKSB7CiAgQGNvbm5lY3QoYWRkZW5kLCByZXN1bHQpCn0KCnJ1bGUgYWRkKHRhcmdldCEsIGFkZGVuZCwgcmVzdWx0KSBhZGQxKHByZXYsIHZhbHVlISkgewogIGFkZDEoYWRkKHByZXYsIGFkZGVuZCksIHJlc3VsdCkKfQoKZnVuY3Rpb24gb25lKCk6IE5hdCB7CiAgcmV0dXJuIGFkZDEoemVybygpKQp9CgpmdW5jdGlvbiB0d28oKTogTmF0IHsKICByZXR1cm4gYWRkKG9uZSgpLCBvbmUoKSkKfQoKZnVuY3Rpb24gdGhyZWUoKTogTmF0IHsKICByZXR1cm4gYWRkKHR3bygpLCBvbmUoKSkKfQoKZnVuY3Rpb24gZm91cigpOiBOYXQgewogIHJldHVybiBhZGQodHdvKCksIHR3bygpKQp9CgovLyBURVNUCgpldmFsIEBpbnNwZWN0KEBydW4oYWRkKHR3bygpLCB0d28oKSkpKQpldmFsIEBpbnNwZWN0KGFkZCh0d28oKSwgdHdvKCkpKQ) ]

```inet
type Nat
Expand Down Expand Up @@ -84,7 +84,7 @@ eval @inspect(add(two(), two()))

### List

[ [Goto The Playground](https://inet.run/playground/dHlwZSBMaXN0KEVsZW1lbnQ6I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kKICAtLS0tLS0tLQogIHZhbHVlITogTGlzdCgnQSkKKQoKbm9kZSBhcHBlbmQoCiAgdGFyZ2V0ITogTGlzdCgnQSksCiAgcmVzdDogTGlzdCgnQSkKICAtLS0tLS0tLQogIHJlc3VsdDogTGlzdCgnQSkKKQoKcnVsZSBhcHBlbmQodGFyZ2V0ISwgcmVzdCwgcmVzdWx0KSBudWxsKHZhbHVlISkgewogIEBjb25uZWN0KHJlc3QsIHJlc3VsdCkKfQoKcnVsZSBhcHBlbmQodGFyZ2V0ISwgcmVzdCwgcmVzdWx0KSBjb25zKGhlYWQsIHRhaWwsIHZhbHVlISkgewogIGNvbnMoaGVhZCwgYXBwZW5kKHRhaWwsIHJlc3QpLCByZXN1bHQpCn0KCi8vIFRFU1QKCnR5cGUgVHJpdmlhbAoKbm9kZSBzb2xlKC0tIHZhbHVlITogVHJpdmlhbCkKCmZ1bmN0aW9uIHNpeFNvbGVzKCk6IExpc3QoVHJpdmlhbCkgewogIHJldHVybiBhcHBlbmQoCiAgICBjb25zKHNvbGUoKSwgY29ucyhzb2xlKCksIGNvbnMoc29sZSgpLCBudWxsKCkpKSksCiAgICBjb25zKHNvbGUoKSwgY29ucyhzb2xlKCksIGNvbnMoc29sZSgpLCBudWxsKCkpKSksCiAgKQp9CgpldmFsIEBpbnNwZWN0KEBydW4oc2l4U29sZXMoKSkpCmV2YWwgQGluc3BlY3Qoc2l4U29sZXMoKSk) ]

```inet
type List(Element: @Type)
Expand Down Expand Up @@ -135,7 +135,7 @@ eval @inspect(sixSoles())

### DiffList

[ [Goto The Playground](https://inet.run/playground/aW1wb3J0IHsgTGlzdCB9IGZyb20gImh0dHBzOi8vY29kZS1vZi1pbmV0LWpzLmZpZGIuYXBwL3N0ZC9kYXRhdHlwZS9MaXN0LmkiCgovLyBDb25jYXRlbmF0aW9uIG9mIGxpc3RzIGlzIHBlcmZvcm1lZCBpbiBsaW5lYXIgdGltZQovLyB3aXRoIHJlc3BlY3QgdG8gaXRzIGZpcn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3QoZnJvbnQsIGNvbnMoc29sZSgpLCBjb25zKHNvbGUoKSwgYmFjaykpKQogIGxldCBmcm9udCwgYmFjaywgdmFsdWUyID0gZGlmZigpCiAgQGNvbm5lY3QoZnJvbnQsIGNvbnMoc29sZSgpLCBjb25zKHNvbGUoKSwgYmFjaykpKQogIHJldHVybiBkaWZmQXBwZW5kKHZhbHVlMSwgdmFsdWUyKQp9CgpldmFsIEBpbnNwZWN0KEBydW4odHdvVHdvU29sZXMoKSkpCmV2YWwgQGluc3BlY3QodHdvVHdvU29sZXMoKSk) ]

```inet
import { List } from "https://code-of-inet-js.fidb.app/std/datatype/List.i"
Expand Down
Loading

0 comments on commit 7370e50

Please sign in to comment.