-
Notifications
You must be signed in to change notification settings - Fork 55
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
discussion: describe relation between Foldable and Unfoldable and there indexed versions #84
Comments
this two functions are describing relation between all 4 classes, we can derive a law doing it the other way might be be an |
I don't think you need a new |
yes but in that case you need special functions like |
Oh I see, you're unfolding with access to the key of the class UnfoldableWithIndex i f | f -> i where
unfoldrWithIndex :: (s -> Maybe ({ value :: a, index :: i, next :: s }) -> s -> f a Is that what you want? That seems strange to me, since I can't write an |
ah yes I was thinking
that's expected I think because linked-ness of List, I guss we can do: |
actually we can name them
|
I had an idea:
What if instead of
You could do:
where
p.s. names
foldWithIndex
andunfoldWithIndex
are arbitrary just types meterThe text was updated successfully, but these errors were encountered: