-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Public export TTImp reflection functions (#2947)
Co-authored-by: Thomas E. Hansen <teh6@st-andrews.ac.uk> Co-authored-by: Ohad Kammar <ohad.kammar@gmail.com>
- Loading branch information
1 parent
bc1a51e
commit a00b7ee
Showing
6 changed files
with
63 additions
and
38 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,18 @@ | ||
module AtTypeLevel | ||
|
||
import Control.Monad.State | ||
|
||
import Language.Reflection | ||
|
||
addName : TTImp -> State (List String) TTImp | ||
addName v@(IVar fc (UN (Basic nm))) = do | ||
modify (nm ::) | ||
pure v | ||
addName s = pure s | ||
|
||
names : TTImp -> List String | ||
names s = execState [] $ mapMTTImp addName s | ||
|
||
checkNames : names `(x * y) = ["y", "x", "*"] | ||
checkNames = Refl | ||
|
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 @@ | ||
1/1: Building AtTypeLevel (AtTypeLevel.idr) |
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,3 @@ | ||
rm -rf build | ||
|
||
$1 --no-color --console-width 0 --no-banner --check AtTypeLevel.idr |