Skip to content

Instantly share code, notes, and snippets.

@Sinha-Ujjawal
Created September 10, 2022 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sinha-Ujjawal/58c9068785d6dbbf64c73a2f74a3eeeb to your computer and use it in GitHub Desktop.
Save Sinha-Ujjawal/58c9068785d6dbbf64c73a2f74a3eeeb to your computer and use it in GitHub Desktop.
Pair Type in Haskell
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