on master help sign in
Started adding pretty printing capabilities for core data types to improve rendering of proof state.
commit9a54230ee65c63ecb01d783a30598eece611d464 authorDominic Mulligan <dominic.p.mulligan@googlemail.com> dateMon 27 Feb 2012, 10:00 (15 years ago) parenta34b377
1 file changed+11
src/Core/TT.hs+11
src/Core/TT.hs+11
@@ -10,6 +10,8 @@ import Data.List
1010import qualified Data.Binary as B
1111import Data.Binary hiding (get, put)
1212
13+import Util.Pretty hiding (Str)
14+
1315{- The language has:
1416 * Full dependent types
1517 * A hierarchy of universes, with cumulativity: Set : Set1, Set1 : Set2, ...
@@ -197,6 +199,15 @@ data Raw = Var Name
197199 | RForce Raw
198200 | RConstant Const
199201 deriving (Show, Eq)
202+
203+instance Sized Raw where
204+ size (Var name) = 1
205+ size (RBind name bind right) = 1 + size bind + size right
206+ size (RApp left right) = 1 + size left + size right
207+ size RSet = 1
208+ size (RForce raw) = 1 + size raw
209+ size (RConstant const) = size const
210+
200211{-!
201212deriving instance Binary Raw
202213!-}