docs(note_create): improve documentation for type checking system

This commit is contained in:
Jakob Schlanstedt 2025-10-22 15:44:55 +02:00 committed by Jakob Schlanstedt
parent 6ddc15849a
commit b82d75674a

View file

@ -15,13 +15,13 @@ import dateNoteService from "../services/date_notes.js";
/**
* Creating notes through note_create can have multiple kinds of valid
* arguments. This type hierchary is checking if the arguments are correct.
* Later the functions are overloaded based on an enum, to fixate the argument
* type and through the type system the legal arguments.
* Later the functions of note_create are overloaded based to reflect these types,
* which define valid arguments.
*
* Theoretically: If the typechecking returns no errors, then the inputs
* create a valid state, but only if the types are defined correctly.
* Through the CurryHoward correspondence, this kinda acts as a proof system
* for correctness of the arguments (I believe that this is the connection here):
* create a valid state, given that the types are defined correctly.
* Through the CurryHoward correspondence, this acts as a proof system
* proving that the arguments will produce a correct state at compile time.
* that just means that if the code type-checks, then the provided options
* represent a valid state. To represent the theoretical bases `type` is
* used instead of `interface`