quox/src/Quox.idr

67 lines
1.4 KiB
Idris
Raw Normal View History

2021-07-07 07:11:39 -04:00
module Quox
2022-02-26 20:18:16 -05:00
import public Quox.Name
2021-09-09 17:51:00 -04:00
import public Quox.Syntax
2022-02-26 20:18:16 -05:00
import public Quox.Equal
import public Quox.Error
2021-07-20 16:05:19 -04:00
import public Quox.Pretty
2022-02-26 20:18:16 -05:00
-- import public Quox.Typechecker
2021-07-20 16:05:19 -04:00
import Data.Nat
import Data.Vect
2022-04-11 08:09:37 -04:00
import Control.ANSI
2021-07-20 16:05:19 -04:00
2022-04-11 08:09:37 -04:00
private
2022-04-11 15:58:33 -04:00
text : PrettyOpts -> List String
2022-04-11 08:09:37 -04:00
text _ =
["",
#" ___ ___ _____ __ __"#,
#"/ _ `/ // / _ \\ \ /"#,
#"\_, /\_,_/\___/_\_\"#,
#" /_/"#,
""]
2022-03-06 19:19:26 -05:00
2022-04-11 08:09:37 -04:00
private
2022-04-11 15:58:33 -04:00
qtuwu : PrettyOpts -> List String
2022-04-11 08:09:37 -04:00
qtuwu opts =
if opts.unicode then
[#" ___,-´⎠ "#,
#"(·`──´ ◡ -´⎠"#,
#" \/´/`´ "#,
#" ⋃────,-₎ ⎞ "#,
#" (‾‾) ⎟ "#,
#" (‾‾‾) ⎟ "#]
else
[#" ___,-´/ "#,
#"(.`--´ u -´/"#,
#" \/\/--´|/`--´ "#,
#" U----,-, \ "#,
#" (--) | "#,
#" (---) | "#]
private
2022-04-11 15:58:33 -04:00
join1 : PrettyOpts -> String -> String -> String
2022-04-11 08:09:37 -04:00
join1 opts l r =
if opts.color then
" " <+> show (colored Green l) <+> " " <+> show (colored Magenta r)
else
" " <+> l <+> " " <+> r
export
2022-04-11 15:58:33 -04:00
banner : PrettyOpts -> String
2022-04-11 08:09:37 -04:00
banner opts = unlines $ zipWith (join1 opts) (qtuwu opts) (text opts)
2022-03-06 19:19:26 -05:00
2021-07-20 16:05:19 -04:00
export
tm : Term 1 2
tm =
2022-04-09 12:54:47 -04:00
(Pi Zero One "a" (BVT 0) (TUsed $ E (F "F" :@@ [BVT 0, FT "w"]))
`DCloT` (K One ::: id))
2021-07-20 16:05:19 -04:00
`CloT` (F "y" ::: TYPE (U 1) :# TYPE (U 2) ::: id)
2021-07-07 07:11:39 -04:00
main : IO Unit
2021-07-20 16:05:19 -04:00
main = do
2022-04-11 15:58:33 -04:00
putStrLn $ banner defPrettyOpts
prettyTermDef tm
prettyTermDef $ pushSubstsT tm