'Kind product in haskell
Can I write a product kind for kind product of kinds without polluting the term level namespace ?
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
data Pair a b = Pair a b
type family Proj1 (asd :: Pair a b) where
Proj1 ('Pair a b) = a
type family Proj2 (asd :: Pair a b) where
Proj2 ('Pair a b) = b
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|