summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T21801.hs
blob: 28add577ec4407b9d6cd855a57343a3e6f7f0f33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# LANGUAGE NoImplicitPrelude #-}
module Endo where

-- This test threw up a WARNING (in a -DDEBUG compiler)
-- in GHC.Core.Opt.Arity.tryEtaReduce

newtype Endo a = Endo { appEndo :: a -> a }

foo :: Endo a -> Endo a -> Endo a
foo (Endo f) (Endo g) = Endo (comp f g)

comp :: (b -> c) -> (a -> b) -> (a -> c)
comp f g x = f (g x)
{-# OPAQUE comp #-}