Skip to content

Commit

Permalink
Add test case for RankNTypes #352
Browse files Browse the repository at this point in the history
  • Loading branch information
anka-213 committed Sep 20, 2024
1 parent b4aa522 commit f9e63fe
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/AllTests.agda
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ import Issue302
import Issue309
import Issue317
import Issue353
import RankNTypes
import ErasedPatternLambda
import CustomTuples
import ProjectionLike
Expand Down Expand Up @@ -173,6 +174,7 @@ import Issue302
import Issue309
import Issue317
import Issue353
import RankNTypes
import ErasedPatternLambda
import CustomTuples
import ProjectionLike
Expand Down
22 changes: 22 additions & 0 deletions test/RankNTypes.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{-# FOREIGN AGDA2HS
{-# LANGUAGE Haskell98 #-}
#-}

data MyBool : Set where
MyTrue : MyBool
MyFalse : MyBool
{-# COMPILE AGDA2HS MyBool #-}

rank2ForallUse : ( (a : Set) a a) MyBool
rank2ForallUse f = f MyBool MyTrue
{-# COMPILE AGDA2HS rank2ForallUse #-}

module _ (f : (a : Set) a a) where
rank2Module : MyBool
rank2Module = f MyBool MyTrue
{-# COMPILE AGDA2HS rank2Module #-}

-- ExistentialQuantification: Not supported yet, but also no error message yet
-- data Exist : Set₁ where
-- MkExist : ∀ (a : Set) → a → Exist
-- {-# COMPILE AGDA2HS Exist #-}
1 change: 1 addition & 0 deletions test/golden/AllTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import Issue302
import Issue309
import Issue317
import Issue353
import RankNTypes
import ErasedPatternLambda
import CustomTuples
import ProjectionLike
Expand Down
14 changes: 14 additions & 0 deletions test/golden/RankNTypes.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Haskell98 #-}

module RankNTypes where

data MyBool = MyTrue
| MyFalse

rank2ForallUse :: (forall a . a -> a) -> MyBool
rank2ForallUse f = f MyTrue

rank2Module :: (forall a . a -> a) -> MyBool
rank2Module f = f MyTrue

0 comments on commit f9e63fe

Please sign in to comment.