summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile/T14578.hs
blob: d0700ea9b0fcd57170d5169fa19d2f27f069ea96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module T14578 where

import Control.Applicative
import Data.Functor.Compose
import Data.Semigroup

newtype App f a = MkApp (f a)
  deriving (Functor, Applicative)

instance (Applicative f, Semigroup a) => Semigroup (App f a) where
  (<>) = liftA2 (<>)

newtype Wat f g a = MkWat (App (Compose f g) a)
  deriving Semigroup