From acfe0381f699d7c11b0ec3d42613a7ee3cb0ee78 Mon Sep 17 00:00:00 2001 From: Robert Attard Date: Wed, 6 Mar 2024 17:15:25 -0500 Subject: [PATCH] readme --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4fc961b..076acd1 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ _Note:_ this method requires all day solutions be in `src/days/` with filenames As of `v0.7.0` gladvent supports modules with functions that provide a `pub fn parse(String)->a` where the type `a` matches with the type of the argument for the runner functions `pt_1` and `pt_2`. If this function is present, gladvent will pick it up and run it only once, providing the output to both runner functions. An example of which looks like this: + ```gleam pub fn parse(input: String) -> Int { let assert Ok(i) = int.parse(input) @@ -95,8 +96,8 @@ pub fn pt_2(input: Int) -> Int { i + 2 } ``` -*Note*: it is on the user to ensure that the types of these functions line up, as `gladvent` does not currently validate types. -*Note*: `gladvent` does not currently include generating a `parse` function via the cli, it is on the user to determine when to use one and add it accordingly. + +_Note_: `gladvent` now leverages gleam's `export package-interface` functionality to type-check your `parse` and `pt_{1|2}` functions to make sure that they are compatible with each other. ## FAQ