A fast, friendly, functional language. https://roc-lang.org
Find a file
Ayaz Hafiz c2452ff751
Lose rigidity of annotated optional fields before generalization
We have this idea of "rigid optional" fields to annotate record fields
that must necessarily be optional. That avoids the admission of programs
we cannot faithfully compile, like

```
f : {a: Str, b ? U64}
f = {a: "b", b: 1}
```

We want to lose the rigidity restriction when a generalized symbol is
used as at a specialized site; for example it should be possible to call
`f : {x ? Str} -> {}` with both `{}` and `{x : Str}`, neither of which
have a rigidly optional field unless they were to be annotated.

Prior to this commit we would loosen the rigidity restriction upon
specialization of a generalized type at a use site. However, what we
really want to do is apply the loosening during calculation of
generalization. The reason is that otherwise, we must make types that
would be ground (like `{x ? Str} -> {}`) generalized just for the sake
of the optional field annotation. But since the rigidity constraint is
irrelevant after an annotated body has been checked, we can loosen the
rigidity restriction then, which conveniently happens to coincide with
the generalization calculation.

Closes #3955
2022-09-06 17:44:04 -05:00
.cargo rename wasm-cli-run -> gen-llvm-wasm 2022-07-10 14:08:35 +02:00
.github auto set date and SHA in filename 2022-09-06 10:57:49 +02:00
.reuse s/rtfeldman/roc-lang/g in links to GitHub repos 2022-08-12 15:24:09 -04:00
ci macos x86_64 nightly testing 2022-09-05 14:49:26 +02:00
crates Lose rigidity of annotated optional fields before generalization 2022-09-06 17:44:04 -05:00
devtools format all Nix source files with nixfmt 2022-08-12 16:15:46 -05:00
examples Merge pull request #3943 from sandprickle/move-examples-3912 2022-09-05 10:38:24 -06:00
getting_started move Zig example 2022-08-31 14:09:34 -04:00
nightly_benches changed Cargo versions from 0.1.0 to 0.0.1 2022-08-03 11:41:19 +02:00
www Exclude Effect.roc from cli docs generation 2022-09-03 21:12:39 -04:00
.earthignore fixed dir copying issue, added earthignore, fixed typos, set up typo checking for CI 2021-06-07 14:55:35 +02:00
.gitignore Update .gitignore 2022-08-01 23:54:55 +02:00
.llvmenv Update .llvmenv 2022-05-09 19:45:09 +02:00
AUTHORS Check for duplicate AUTHORS 2022-08-25 07:43:44 +01:00
BUILDING_FROM_SOURCE.md further additions for building on windows 2022-09-02 20:36:31 +02:00
Cargo.lock remove either dependency 2022-09-06 18:52:43 +02:00
Cargo.toml Add an interner crate 2022-08-31 14:33:51 -05:00
CODE_OF_CONDUCT.md Rename CodeOfConduct.md to CODE_OF_CONDUCT.md 2022-04-10 19:06:05 +08:00
CONTRIBUTING.md mention recommended forking strategy 2022-08-24 14:50:47 +02:00
default.nix format all Nix source files with nixfmt 2022-08-12 16:15:46 -05:00
Earthfile moved spellcheck, removed unused Earthfile 2022-08-27 18:14:28 +02:00
FAQ.md tiny typo fix 2022-08-25 14:46:54 -05:00
flake.lock moved to nix unstable 2022-08-22 18:21:03 +02:00
flake.nix moved to nix unstable 2022-08-22 18:21:03 +02:00
LEGAL_DETAILS remove unused install-ci-libraries.sh 2022-05-09 09:24:37 +02:00
LICENSE Use © instead of (c) for copyright symbol 2021-05-03 21:18:36 -04:00
README.md make README more human friendly 2022-08-23 17:23:57 +02:00
roc-for-elm-programmers.md Update roc-for-elm-programmers.md 2022-08-16 10:17:32 -04:00
rust-toolchain.toml nix-build works 2022-07-27 14:35:39 +02:00
shell.nix formatted nix files 2022-06-03 16:51:54 +02:00
TUTORIAL.md Fix typo 2022-09-06 10:18:49 +02:00
typos.toml moved spellcheck, removed unused Earthfile 2022-08-27 18:14:28 +02:00
version.txt Have version.txt include newlines; don't add any 2022-06-18 22:41:56 -04:00

Work in progress!

Roc is not ready for a 0.1 release yet, but we do have:

If you'd like to get involved in contributing to the language, the Zulip chat is also the best place to get help with good first issues.

Sponsors

We are very grateful to our sponsors NoRedInk, rwx, and Tweede golf.

NoRedInk logo      rwx logo      tweede golf logo

If you or your employer would like to sponsor Roc's development, please DM Richard Feldman on Zulip!