Adding class constraints to typeclass instance
- by BleuM937
I'm trying to implement the Cantor Pairing Function, as an instance of a
generic Pair typeclass, as so:
module Pair (Pair, CantorPair) where
-- Pair interface
class Pair p where
pi :: a -> a -> p a
k :: p a -> a
l :: p a -> a
-- Wrapper for typing
newtype CantorPair a = P { unP :: a }
-- Assume two functions with…