{-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Compiling.Functor.Test where import Test.Tasty import Data.Proxy (Proxy(..)) import Prelude hiding ((&&), not, (||)) import Language.Symantic.Typing import Compiling.Term.Test import Compiling.Bool.Test () type Ifaces = [ Proxy (->) , Proxy Bool , Proxy Functor , Proxy Integer , Proxy Maybe ] (==>) = test_compile (Proxy::Proxy Ifaces) tests :: TestTree tests = testGroup "Functor" [ "fmap not (Just True)" ==> Right ( ty @Maybe :$ ty @Bool , Just False , "fmap (\\x0 -> not x0) (Just True)") , "not `fmap` Just True" ==> Right ( ty @Maybe :$ ty @Bool , Just False , "fmap (\\x0 -> not x0) (Just True)") , "not <$> Just True" ==> Right ( ty @Maybe :$ ty @Bool , Just False , "fmap (\\x0 -> not x0) (Just True)") , "False <$ Just True" ==> Right ( ty @Maybe :$ ty @Bool , Just False , "False <$ Just True" ) ]