Carp/docs
Scott Olsen f4bcc28fc0
feat: register-type improvements (#1332)
* fix: don't instantiate dummy fields for external types

For ANSI C compatibility reasons, we add a dummy field for memberless
types defined in Carp (see commit 59ef5bbf2b). When registering a type
with no fields, `(register-type A [])`, we'd also attempt to set our
dummy field in the Carp generated initializer for the type. However, the
registered type is totally opaque from the perspective of Carp, and we
can't assume it has a field corresponding to our dummy field.

This commit changes our handling of __dummy in initializers to avoid
setting it for registered types.

* feat: automatically implement str and prn for registered types

This commit makes the auto-generated str and prn functions for
registered types implement the str and prn interfaces, removing the need
for users to call implements on these functions explicitly.

It alters the signature of `autoDerive` in Primitives.hs slightly to
make it more flexible (since registered types have no delete or copy
functions that we can add to the implementation lists of these
interfaces).

* docs: add docs on register-type to CInterop.md

The new documentation clarifies the usage of `register-type` and accounts
for the changes in the prior two commits.

* fix: fix function signatures for generic memberless initers

Filter out dummy field arguments.

* docs: Add details about type name overrides to CInterop.md

* docs: clarify that users can implement delete for registered types
2021-10-18 16:48:02 +02:00
..
core feat: Emit docs for top level bindings (#1253) 2021-06-28 19:56:59 +02:00
sdl feat: Emit docs for top level bindings (#1253) 2021-06-28 19:56:59 +02:00
carp_on_arduboy.jpg PR: additional local documentation as html (#1229) 2021-05-31 10:15:09 +02:00
CInterop.md feat: register-type improvements (#1332) 2021-10-18 16:48:02 +02:00
compiler-passes.drawio docs: add diagrams 2020-04-17 17:27:43 +02:00
compiler-passes.svg docs: add diagrams 2020-04-17 17:27:43 +02:00
Contributing.md chore: Creates pre-commit hook to format Haskell code (#1047) 2020-12-05 14:26:28 +01:00
Derive.md feat: Derive (#1120) 2021-01-15 10:48:34 +01:00
Drop.md feat: Add drop interface (#1088) 2021-01-31 21:15:10 +01:00
DynamicSemantics.md docs: fix some typos and minor grammatical errors 2020-07-26 08:30:37 +10:00
Embedded.md PR: additional local documentation as html (#1229) 2021-05-31 10:15:09 +02:00
Format_Strings.md docs: don’t confuse liquid (#1152) 2021-01-26 13:21:20 +01:00
hacking.md docs: fix some typos and minor grammatical errors 2020-07-26 08:30:37 +10:00
HowToRunCode.md docs: Clarifications 2020-11-24 06:45:51 +01:00
index.md PR: additional local documentation as html (#1229) 2021-05-31 10:15:09 +02:00
Install.md Update Install.md (#1324) 2021-10-11 16:02:33 +02:00
LanguageGuide.md feat: add compiler error on maximum sumtype constructors (#1319) 2021-09-18 08:49:19 +02:00
Libraries.md PR: additional local documentation as html (#1229) 2021-05-31 10:15:09 +02:00
Macros.md docs: fix typo in Macros.md (#1331) 2021-10-12 17:52:24 +02:00
Manual.md docs: A document about running code (#1013) 2020-11-24 06:40:31 +01:00
Memory.md docs: Updates memory docs to discourage overriding delete (#1245) 2021-06-15 10:42:13 +02:00
Multimedia.md fix: Level of heading 2020-11-20 08:25:20 +01:00
patterns.md Fix link to Memory.md in patterns.md (#1073) 2020-12-16 10:09:00 +01:00
Quasiquotation.md feat: Quasiquotation (#1129) 2021-01-15 10:50:04 +01:00
ReleaseChecklist.md build: 0.5.2 2021-09-08 19:59:00 +02:00
Terminology.md docs: fix some typos and minor grammatical errors 2020-07-26 08:30:37 +10:00
Tooling.md refactor: Move emacs-mode to separate repo (#981) 2020-11-20 07:48:21 +01:00