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

add arrow2..arrowN helper function #37

Open
illusory0x0 opened this issue Jan 16, 2025 · 0 comments
Open

add arrow2..arrowN helper function #37

illusory0x0 opened this issue Jan 16, 2025 · 0 comments

Comments

@illusory0x0
Copy link
Contributor

illusory0x0 commented Jan 16, 2025

fn arrow2_curry[A, B, C](f : (A, B) -> C) -> @qc.Arrow[A, @qc.Arrow[B, C]] {
  @unsafe.coerce(@fun.curry2(f))
}

fn arrow2_tuple[A, B, C](f : (A, B) -> C) -> @qc.Arrow[(A, B), C] {
  fn(tuple : (A, B)) -> C { f(tuple.0, tuple.1) } |> @qc.Arrow
}
  • use arrow2_tuple implement this wrapper function

    • implement Arbitrary for TupleN in core library.
    • implement Shrink for TupleN
    • ... other traits in quickcheck
  • use arrow2_curry, we need to test coerce and sacrifice performance.

Tuple version is 1.2 times faster than curry version,
but curry version is 1.77 times faster than forall

@illusory0x0 illusory0x0 changed the title deprecate forall function improve forall function performance Jan 16, 2025
@illusory0x0 illusory0x0 changed the title improve forall function performance add arrow2..arrowN helper function Jan 16, 2025
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

No branches or pull requests

1 participant