Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TanklesXL committed Mar 6, 2024
1 parent b2c4eb1 commit acfe038
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down

0 comments on commit acfe038

Please sign in to comment.