{-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -O0 #-} -- speedup compile-timeā€¦ module Compiling.Foldable.Test where import Test.Tasty import Data.Proxy (Proxy(..)) import Language.Symantic.Typing import Language.Symantic.Compiling import Compiling.Term.Test -- * Tests type Ifaces = [ Proxy (->) , Proxy [] , Proxy Int , Proxy Foldable ] (==>) = test_term_from (Proxy::Proxy Ifaces) tests :: TestTree tests = testGroup "Foldable" [ Syntax "foldMap" [ syLam (Syntax "x" []) syInt $ Syntax "list" [ syInt , Syntax "x" [] , Syntax "x" [] ] , Syntax "list" [ syInt , Syntax "int" [Syntax "1" []] , Syntax "int" [Syntax "2" []] , Syntax "int" [Syntax "3" []] ] ] ==> Right ( tyList :$ tyInt , [1, 1, 2, 2, 3, 3] , "foldMap (\\x0 -> [x0, x0]) [1, 2, 3]" ) ]