duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
{-# LANGUAGE ConstraintKinds, DataKinds, PolyKinds, TypeFamilies, TypeOperators #-} | |
import GHC.Exts (Constraint) | |
type family Restrict (a :: k) (as :: [k]) :: Constraint where | |
Restrict a (a ': as) = ("Error!" ~ "Tried to apply a restricted type!") | |
Restrict x (a ': as) = Restrict x as | |
Restrict x '[] = () | |
foo :: Restrict a [(), Int] => a -> a |