{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}

{-# OPTIONS_GHC -fplugin=IfSat.Plugin #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module M2 where

import M1

--------------------------------------------------------------------------------


instance Show ( Bool -> Bool ) where
  show :: (Bool -> Bool) -> String
show Bool -> Bool
f = forall a. Show a => a -> String
show [ Bool -> Bool
f Bool
False, Bool -> Bool
f Bool
True ]

test2 :: ( a -> a ) -> String
test2 :: forall a. (a -> a) -> String
test2 a -> a
fun = forall a. IfSat (Show (a -> a)) => (a -> a) -> String
showFun a -> a
fun

test3 :: ( Bool -> Bool ) -> String
test3 :: (Bool -> Bool) -> String
test3 Bool -> Bool
fun = forall a. IfSat (Show (a -> a)) => (a -> a) -> String
showFun Bool -> Bool
fun

test :: String
test :: String
test =
  [String] -> String
unlines
    [ (Bool -> Bool) -> String
test1 Bool -> Bool
not
    , forall a. (a -> a) -> String
test2 Bool -> Bool
not
    , (Bool -> Bool) -> String
test3 Bool -> Bool
not
    , forall a. IfSat (Show (a -> a)) => (a -> a) -> String
showFun Bool -> Bool
not
    ]

instance C
C

unsafeCoerce :: Float -> String
unsafeCoerce :: Float -> String
unsafeCoerce Float
x = Float -> F (IsSat C)
foo Float
x