Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {-# LANGUAGE ConstraintKinds, DataKinds, TypeOperators, TypeFamilies #-}
- import GHC.Exts
- type A a = Num a ': Eq a ': Ord a ': '[]
- type family ListOfConstraints (a :: [Constraint]) :: Constraint where
- ListOfConstraints '[] = ()
- ListOfConstraints (c ': cs) = (c, ListOfConstraints cs)
- f :: ListOfConstraints (A a) => a -> a -> a
- f x y = max x y * 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement