-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ fix #210 ] More robust calculation of which arguments to drop via g…
…etDefFreeVars
- Loading branch information
1 parent
10c76cc
commit edbf2ee
Showing
6 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
open import Haskell.Prelude hiding (f) | ||
|
||
record Test (a : Set) : Set₁ where | ||
field | ||
f : a -> a | ||
open Test {{...}} public | ||
{-# COMPILE AGDA2HS Test class #-} | ||
|
||
instance | ||
testNat : Test Nat | ||
Test.f testNat n = h | ||
where | ||
g : Nat | ||
g = 3 + n | ||
h : Nat | ||
h = n + g | ||
{-# COMPILE AGDA2HS testNat #-} | ||
|
||
f1 : Nat -> Nat | ||
f1 n = h1 | ||
where | ||
g1 : Nat | ||
g1 = 3 + n | ||
h1 : Nat | ||
h1 = n + g1 | ||
{-# COMPILE AGDA2HS f1 #-} | ||
|
||
f2 : Nat -> Nat | ||
f2 n = h2 n | ||
where | ||
g2 : Nat | ||
g2 = 3 + n | ||
h2 : Nat -> Nat | ||
h2 m = n + g2 + m | ||
{-# COMPILE AGDA2HS f2 #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,4 +57,5 @@ import IOFile | |
import IOInput | ||
import Issue200 | ||
import Issue169 | ||
import Issue210 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module Issue210 where | ||
|
||
import Numeric.Natural (Natural) | ||
|
||
class Test a where | ||
f :: a -> a | ||
|
||
instance Test Natural where | ||
f n = h | ||
where | ||
g :: Natural | ||
g = 3 + n | ||
h :: Natural | ||
h = n + g | ||
|
||
f1 :: Natural -> Natural | ||
f1 n = h1 | ||
where | ||
g1 :: Natural | ||
g1 = 3 + n | ||
h1 :: Natural | ||
h1 = n + g1 | ||
|
||
f2 :: Natural -> Natural | ||
f2 n = h2 n | ||
where | ||
g2 :: Natural | ||
g2 = 3 + n | ||
h2 :: Natural -> Natural | ||
h2 m = n + g2 + m | ||
|