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

TailRec ADT with Loop/Done constructors to make intent more explicit #2

Closed
wants to merge 5 commits into from

Conversation

jacereda
Copy link

No description provided.

@paf31
Copy link
Contributor

paf31 commented Feb 18, 2015

I like it, but I don't think the type constructor name TailRec is very instructive. That said, I can't think of many better options either. Maybe Result, or Step?

@jacereda
Copy link
Author

I'm not sure what would look good in a type signature. Well, something like this would look good:

go :: Number -> Eff (trace :: Trace) (Number `StepsYielding` Unit)

but joking aside I guess Step is better than TailRec.

go (Loop a) = go (f a)
go (Done b) = b

isLoop :: forall a b. Step a b -> Boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please move this into the where block?

@safareli
Copy link
Contributor

safareli commented Sep 1, 2016

any updates on this?

@paf31
Copy link
Contributor

paf31 commented Sep 2, 2016

I'd like to do this, but we'll need to wait until the next round of breaking changes since it affects lots of downstream libraries.

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.

3 participants