Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / indexed-types / should_compile / T3590.hs
1 {-# LANGUAGE TypeFamilies, FlexibleContexts #-}
2
3 -- #3590: a bug in typechecking of sections
4
5 module T3590 where
6
7 import Data.Kind (Type)
8
9 newtype ListT m a =
10 ListT { runListT :: m (Maybe (a, ListT m a)) }
11
12 class Monad (ItemM l) => List l where
13 type ItemM l :: Type -> Type
14 joinL :: [ItemM l (l a) -> l a]
15
16 instance Monad m => List (ListT m) where
17 type ItemM (ListT m) = m
18 joinL = [ ListT . (>>= runListT) -- Right section
19 , ListT . (runListT <<=) -- Left section
20 ]
21
22 (<<=) :: Monad m => (a -> m b) -> m a -> m b
23 (<<=) k m = m >>= k
24