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

yampa: Function FRP.Yampa.Switches.safeZip is overly complicated #298

Closed
ivanperez-keera opened this issue Jun 9, 2024 · 0 comments
Closed
Assignees
Milestone

Comments

@ivanperez-keera
Copy link
Owner

ivanperez-keera commented Jun 9, 2024

This function captures a list and then applies some head and tail alternative functions to it, when it could be simplified to pattern match on the list.

@ivanperez-keera ivanperez-keera added this to the 0.14.9 milestone Jun 9, 2024
@ivanperez-keera ivanperez-keera self-assigned this Jun 9, 2024
@ivanperez-keera ivanperez-keera changed the title yampa: Function FRP.Yampa.Switches is overly complicated yampa: Function FRP.Yampa.Switches.safeZip is overly complicated Jun 9, 2024
ivanperez-keera added a commit that referenced this issue Jun 9, 2024
The function FRP.Yampa.Switches.safeZip, or more specifically, safeZip'
inside it, captures a list and then applies some head and tail
alternative functions to it.

This commit reduces the function by pattern matching on the list,
already obtaining the head and the tail. We move the error reporting to
a third, default case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant