Skip to content

Commit

Permalink
added test for proj-like reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
flupe authored and omelkonian committed Feb 20, 2024
1 parent 9bc93a6 commit 21508e1
Show file tree
Hide file tree
Showing 4 changed files with 35 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 @@ -70,6 +70,7 @@ import Issue257
import Delay
import Issue273
import TypeDirected
import ProjLike

{-# FOREIGN AGDA2HS
import Issue14
Expand Down Expand Up @@ -139,4 +140,5 @@ import EraseType
import Delay
import Issue273
import TypeDirected
import ProjLike
#-}
22 changes: 22 additions & 0 deletions test/ProjLike.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module ProjLike where

open import Haskell.Prelude

module M (a : Set) where

data Scope : Set where
Empty : Scope
Bind : a Scope Scope

{-# COMPILE AGDA2HS Scope #-}

unbind : Scope Scope
unbind Empty = Empty
unbind (Bind _ s) = s

open M Nat public

test : Scope
test = unbind (Bind 1 (Bind 2 Empty))

{-# COMPILE AGDA2HS test #-}
1 change: 1 addition & 0 deletions test/golden/AllTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ import EraseType
import Delay
import Issue273
import TypeDirected
import ProjLike

10 changes: 10 additions & 0 deletions test/golden/ProjLike.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module ProjLike where

import Numeric.Natural (Natural)

data Scope a = Empty
| Bind a (Scope a)

test :: Scope Natural
test = Bind 2 Empty

0 comments on commit 21508e1

Please sign in to comment.