| 1 |
{-# OPTIONS --guardedness --sized-types #-} |
| 2 |
|
| 3 |
module Main where |
| 4 |
|
| 5 |
open import Data.List.Base as List using (_∷_; []) |
| 6 |
open import Data.String.Base as String using (String) |
| 7 |
open import Data.Unit.Base using (⊤) |
| 8 |
open import Function.Base using (_$_; id) |
| 9 |
|
| 10 |
open import Reflection using (TC; Term; getType; getDefinition) |
| 11 |
open import Reflection.AST.Show |
| 12 |
|
| 13 |
macro |
| 14 |
runTC : TC String → Term → TC ⊤ |
| 15 |
runTC tc t = let open Reflection in do |
| 16 |
u ← tc |
| 17 |
unify t (lit (string u)) |
| 18 |
|
| 19 |
open import IO.Base hiding (_<$>_) |
| 20 |
open import IO.Finite |
| 21 |
|
| 22 |
open import Reflection.TCM.Syntax using (_<$>_) |
| 23 |
|
| 24 |
main : Main |
| 25 |
main = run $ do |
| 26 |
let name = quote List.map |
| 27 |
putStr $ showName name String.++ " : " |
| 28 |
putStrLn $ runTC (showTerm <$> getType name) |
| 29 |
putStr $ showName name String.++ " = " |
| 30 |
putStrLn $ runTC (showDefinition <$> getDefinition name) |