2022-09-28 05:05:16 +00:00
|
|
|
{-# OPTIONS --guardedness #-}
|
|
|
|
|
|
|
|
-- this one has main
|
|
|
|
|
|
|
|
module Calc where
|
|
|
|
|
|
|
|
open import Agda.Builtin.Char
|
2022-09-28 22:06:38 +00:00
|
|
|
open import Agda.Builtin.Maybe
|
2022-09-28 05:05:16 +00:00
|
|
|
open import Agda.Builtin.Nat
|
|
|
|
open import Agda.Builtin.String
|
|
|
|
open import Data.Nat.Show
|
|
|
|
open import IO
|
|
|
|
|
2022-09-29 13:23:43 +00:00
|
|
|
open import Eval
|
2022-09-28 05:05:16 +00:00
|
|
|
open import Parse
|
2022-09-30 04:07:05 +00:00
|
|
|
open import Show
|
2022-09-28 05:05:16 +00:00
|
|
|
open import Util
|
|
|
|
|
|
|
|
main : Main
|
2022-09-29 13:23:43 +00:00
|
|
|
main = run (getLine >>= λ c → putStrLn (showList (showResult show) (map evalBin (takeLine (primStringToList c)))))
|
|
|
|
|
|
|
|
-- singular version
|
|
|
|
-- main = run (getLine >>= λ c → putStrLn (showResult show (evalBin (takeBin (primStringToList c)))))
|