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

Better interface to smart constructor generation with decapitalized names #263

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

lsrcz
Copy link
Owner

@lsrcz lsrcz commented Dec 8, 2024

This pull request adds better interface to smart constructors.

Given the data type

data T a = T1 | T2 a
makeSmartCtor ''T

will now generate

t1 :: (Mergeable (T a), Applicative m, TryMerge m) => m (T a)
t1 = mrgSingle T1
t2 :: (Mergeable (T a), Applicative m, TryMerge m) => a -> m (T a)
t2 = \x -> mrgSingle (T2 x)

@lsrcz lsrcz force-pushed the feat-better-smart-ctor branch from c06fb3c to ec438d3 Compare December 8, 2024 03:48
@lsrcz lsrcz merged commit e9860b2 into main Dec 8, 2024
5 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant