Don't skip validity checks for built-in classes (#17355)
[ghc.git] / testsuite / tests / typecheck / should_compile / tc258.hs
1 {-# LANGUAGE ConstraintKinds, TypeFamilies, UndecidableInstances #-}
2
3 module AltPrelude where
4
5 import Data.Kind (Constraint)
6
7 class MyFunctor f where
8 type FunctorCtxt f a :: Constraint
9 type FunctorCtxt f a = ()
10 (<$>) :: (FunctorCtxt f a, FunctorCtxt f b) => (a -> b) -> f a -> f b
11
12 class MyFunctor ap => MyApplicative ap where
13 type ApplicativeCtxt ap a :: Constraint
14 type ApplicativeCtxt ap a = FunctorCtxt ap a
15 (<***>) :: (ApplicativeCtxt ap a, ApplicativeCtxt ap b) => ap (a -> b) -> ap a -> ap b