Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow reading files into any FromJSON #60

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

carbolymer
Copy link
Contributor

This PR generalizes readJsonFile and similar funcitons which used to operate on Values. Now it's possible to deserialize to and serialize from any FromJSON and ToJSON.

To use previous form of a function, use a type annotation:

readJsonFile @Value :: (MonadTest m, MonadIO m, HasCallStack) => FilePath -> m (Either String Value)

@carbolymer carbolymer merged commit 25fecf8 into main Feb 13, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants