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

Pair #10

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Pair #10

wants to merge 7 commits into from

Conversation

tttardigrado
Copy link
Contributor

Add an implementation of a Pair[A, B] type equivalent to haskel's (a, b)

  • New: Constructor for the Pair type
  • Fst: Destructor returning the first element
  • Snd: Destructor returning the second element
  • Get: Destructor converting a Pair into 2 separate values
  • MapFst, MapSnd and MapBoth: Map implementation for the first, second and both values respectively
  • CheckFst, CheckSnd and CheckBoth: Check if the first, second and both values respectively, satisfy a predicate
  • Merge and MergeC: Get the result of a function that consumes both values as arguments
  • Zip: Transform 2 lists into a list of pairs
  • Eq: Check two Pairs for equality

@codecov
Copy link

codecov bot commented Aug 15, 2022

Codecov Report

Merging #10 (f548a63) into main (1684a67) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #10   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        12    +1     
  Lines          119       146   +27     
=========================================
+ Hits           119       146   +27     
Impacted Files Coverage Δ
pair/pair.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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.

1 participant