Created
September 10, 2022 13:18
-
-
Save Sinha-Ujjawal/58c9068785d6dbbf64c73a2f74a3eeeb to your computer and use it in GitHub Desktop.
Pair Type in Haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Pair a b = Pair a b | |
fst :: Pair a b -> a | |
fst (Pair a _) = a | |
snd :: Pair a b -> b | |
snd (Pair _ b) = b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment