{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_GHC -O0 -fmax-simplifier-iterations=0 #-}
module Lib.Foldable.Test where

import Test.Tasty

import Data.Proxy (Proxy(..))
import Prelude hiding ((&&), not, (||))

import Language.Symantic.Typing
import Compiling.Term.Test

type Ifaces =
 [ Proxy (->)
 , Proxy Int
 , Proxy Integer
 , Proxy []
 , Proxy ()
 , Proxy (,)
 , Proxy Foldable
 ]
(==>) = test_compile @Ifaces

tests :: TestTree
tests = testGroup "Foldable"
 [ "[] @Integer" ==> Right
	 ( ty @[] :$ ty @Integer
	 , []
	 , "[]" )
 , "[1, 2, 3]" ==> Right
	 ( ty @[] :$ ty @Integer
	 , [1, 2, 3]
	 , "1 : 2 : 3 : []" )
 , "foldMap (\\(x0:Integer) -> [x0, x0]) [1, 2, 3]" ==> Right
	 ( ty @[] :$ ty @Integer
	 , [1, 1, 2, 2, 3, 3]
	 , "foldMap (\\x0 -> x0 : x0 : []) (1 : 2 : 3 : [])" )
 ]