on master help sign in
Merge remote-tracking branch 'refs/remotes/origin/wip/tactical' into wip/tactical
commit6cd99f3f329240480a2aba5df2fae0e73e53aff8 authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateFri 12 Jun 2015, 16:12 (11 years ago) parent0510928b2dc1fc
2 files changed+16
src/Idris/Prover.hs+8 src/Idris/Reflection.hs+8
src/Idris/Prover.hs+8
@@ -1,6 +1,14 @@
11{-# LANGUAGE PatternGuards #-}
22module Idris.Prover (prover, showProof, showRunElab) where
33
4+-- Hack for GHC 7.10 and earlier compat without CPP or warnings
5+-- This exludes (<$>) as fmap, because wl-pprint uses it for newline
6+import Prelude (Eq(..), Show(..),
7+ Bool(..), Either(..), Maybe(..), String,
8+ (.), ($), (++),
9+ concatMap, id, elem, error, fst, flip, foldl, foldr, init,
10+ length, lines, map, not, null, repeat, reverse, tail, zip)
11+
412import Idris.Core.Elaborate hiding (Tactic(..))
513import Idris.Core.TT
614import Idris.Core.Evaluate
src/Idris/Reflection.hs+8
@@ -161,8 +161,16 @@ reifyTTApp t [t', Constant (I i)]
161161 return $ Proj t'' i
162162reifyTTApp t [tt]
163163 | t == reflm "TType" = liftM TType (reifyTTUExp tt)
164+reifyTTApp t [tt]
165+ | t == reflm "UType" = liftM UType (reifyUniverse tt)
164166reifyTTApp t args = fail ("Unknown reflection term: " ++ show (t, args))
165167
168+reifyUniverse :: Term -> ElabD Universe
169+reifyUniverse (P _ n _) | n == reflm "AllTypes" = return AllTypes
170+ | n == reflm "UniqueType" = return UniqueType
171+ | n == reflm "NullType" = return NullType
172+reifyUniverse tm = fail ("Unknown reflection universe: " ++ show tm)
173+
166174-- | Reify raw terms from their reflected representation
167175reifyRaw :: Term -> ElabD Raw
168176reifyRaw t@(App _ _ _)