summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T7641.hs
blob: 5d68f4f8bffdc87a4a24aa163a43b5bc1a12ae03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}

module T7641 where

data Foo b = Foo deriving Show

class ToFoo a b where
    toFoo :: a -> Foo b

instance ToFoo (c -> ()) b where
    toFoo _ = Foo

baz () = toFoo $ \_ -> ()