summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T11608.hs
blob: 5627135b5bc8fbdeaf645ebec6fb571632112952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}

module T11608 where

type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t

class Each s t a b | s -> a, t -> b, s b -> t, t a -> s where
  each :: Traversal s t a b
  default each :: (Traversable g, s ~ g a, t ~ g b) => Traversal s t a b
  each = traverse