import Data.Proxy (Proxy(..))
import Prelude hiding ((&&), not, (||))
-import Language.Symantic.Typing
-import Compiling.Term.Test
+import Language.Symantic.Lib
+import Compiling.Test
import Lib.Bool.Test ()
-type Ifaces =
+type SS =
[ Proxy (->)
, Proxy Integer
, Proxy Bool
, Proxy Functor
, Proxy Applicative
]
-(==>) = test_compile @Ifaces
+(==>) = readTe @() @SS
tests :: TestTree
tests = testGroup "Applicative"
- [ "Just (xor True) <*> Just True" ==> Right
- ( ty @Maybe :$ ty @Bool
- , Just False
- , "(\\x0 -> Just ((\\x1 -> (\\x2 -> x1 `xor` x2)) True) <*> x0) (Just True)" )
- , "Just (xor True) <*> Nothing @Bool" ==> Right
- ( ty @Maybe :$ ty @Bool
- , Nothing
- , "(\\x0 -> Just ((\\x1 -> (\\x2 -> x1 `xor` x2)) True) <*> x0) Nothing" )
- , "xor <$> Just True <*> Just False" ==> Right
- ( ty @Maybe :$ ty @Bool
- , Just True
- , "(\\x0 -> fmap (\\x1 -> (\\x2 -> x1 `xor` x2)) (Just True) <*> x0) (Just False)" )
- , "Just False <* Just True" ==> Right
- ( ty @Maybe :$ ty @Bool
- , Just False
- , "Just False <* Just True" )
- , "Just False *> Just True" ==> Right
- ( ty @Maybe :$ ty @Bool
- , Just True
- , "Just False *> Just True" )
+ [ "Just (xor True) <*> Just True" ==> Right (tyMaybe tyBool, Just False, "Just (\\x0 -> True `xor` x0) <*> Just True")
+ , "Just (xor True) <*> Nothing" ==> Right (tyMaybe tyBool, Nothing , "Just (\\x0 -> True `xor` x0) <*> Nothing")
+ , "xor <$> Just True <*> Just False" ==> Right (tyMaybe tyBool, Just True , "(\\x0 -> (\\x1 -> x0 `xor` x1)) <$> Just True <*> Just False")
+ , "Just False <* Just True" ==> Right (tyMaybe tyBool, Just False, "Just False <* Just True")
+ , "Just False *> Just True" ==> Right (tyMaybe tyBool, Just True , "Just False *> Just True")
]