Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upImprove List.scanl #574
Conversation
jvoigtlaender
closed this
May 27, 2016
jvoigtlaender
deleted the
jvoigtlaender:scanl
branch
May 27, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jvoigtlaender commentedApr 28, 2016
•
edited
Edited 1 time
-
jvoigtlaender
edited May 26, 2016 (most recent)
This has the exact same semantics as the current implementation of
List.scanl.The reason I consider it to be an improvement is the following lines in the current implementation:
If something cannot happen, it's better to use types than code comments to express that. My version has that quality.
(If the current implementation stays, I think it would be more appropriate to replace the line
[] -- impossibleby a call toDebug.crash.)