Safe Haskell | None |
---|---|
Language | Haskell2010 |
Stuff for sized types that does not require modules Agda.TypeChecking.Reduce or Agda.TypeChecking.Constraints (which import Agda.TypeChecking.Monad).
Synopsis
- data BoundedSize
- class IsSizeType a where
- isSizeType :: a -> TCM (Maybe BoundedSize)
- isSizeTypeTest :: TCM (Term -> Maybe BoundedSize)
- getBuiltinDefName :: String -> TCM (Maybe QName)
- getBuiltinSize :: TCM (Maybe QName, Maybe QName)
- isSizeNameTest :: TCM (QName -> Bool)
- isSizeNameTestRaw :: TCM (QName -> Bool)
- haveSizedTypes :: TCM Bool
- haveSizeLt :: TCM Bool
- builtinSizeHook :: String -> QName -> Type -> TCM ()
- sizeSort :: Sort
- sizeUniv :: Type
- sizeType_ :: QName -> Type
- sizeType :: TCM Type
- sizeSucName :: TCM (Maybe QName)
- sizeSuc :: Nat -> Term -> TCM Term
- sizeSuc_ :: QName -> Term -> Term
- sizeMax :: NonemptyList Term -> TCM Term
- data SizeView
- sizeView :: Term -> TCM SizeView
- type Offset = Nat
- data DeepSizeView
- data SizeViewComparable a
- sizeViewComparable :: DeepSizeView -> DeepSizeView -> SizeViewComparable ()
- sizeViewSuc_ :: QName -> DeepSizeView -> DeepSizeView
- sizeViewPred :: Nat -> DeepSizeView -> DeepSizeView
- sizeViewOffset :: DeepSizeView -> Maybe Offset
- removeSucs :: (DeepSizeView, DeepSizeView) -> (DeepSizeView, DeepSizeView)
- unSizeView :: SizeView -> TCM Term
- unDeepSizeView :: DeepSizeView -> TCM Term
- type SizeMaxView = NonemptyList DeepSizeView
- type SizeMaxView' = [DeepSizeView]
- maxViewMax :: SizeMaxView -> SizeMaxView -> SizeMaxView
- maxViewCons :: DeepSizeView -> SizeMaxView -> SizeMaxView
- sizeViewComparableWithMax :: DeepSizeView -> SizeMaxView -> SizeViewComparable SizeMaxView'
- maxViewSuc_ :: QName -> SizeMaxView -> SizeMaxView
- unMaxView :: SizeMaxView -> TCM Term
Testing for type Size
data BoundedSize Source #
Result of querying whether size variable i
is bounded by another
size.
Instances
Eq BoundedSize Source # | |
Defined in Agda.TypeChecking.Monad.SizedTypes (==) :: BoundedSize -> BoundedSize -> Bool # (/=) :: BoundedSize -> BoundedSize -> Bool # | |
Show BoundedSize Source # | |
Defined in Agda.TypeChecking.Monad.SizedTypes showsPrec :: Int -> BoundedSize -> ShowS # show :: BoundedSize -> String # showList :: [BoundedSize] -> ShowS # |
class IsSizeType a where Source #
Check if a type is the primSize
type. The argument should be reduce
d.
isSizeType :: a -> TCM (Maybe BoundedSize) Source #
Instances
IsSizeType Term Source # | |
Defined in Agda.TypeChecking.Monad.SizedTypes isSizeType :: Term -> TCM (Maybe BoundedSize) Source # | |
IsSizeType a => IsSizeType (Dom a) Source # | |
Defined in Agda.TypeChecking.Monad.SizedTypes isSizeType :: Dom a -> TCM (Maybe BoundedSize) Source # | |
IsSizeType a => IsSizeType (Type' a) Source # | |
Defined in Agda.TypeChecking.Monad.SizedTypes isSizeType :: Type' a -> TCM (Maybe BoundedSize) Source # | |
IsSizeType a => IsSizeType (b, a) Source # | |
Defined in Agda.TypeChecking.Monad.SizedTypes isSizeType :: (b, a) -> TCM (Maybe BoundedSize) Source # |
isSizeTypeTest :: TCM (Term -> Maybe BoundedSize) Source #
haveSizedTypes :: TCM Bool Source #
Test whether OPTIONS --sized-types and whether the size built-ins are defined.
haveSizeLt :: TCM Bool Source #
Test whether the SIZELT builtin is defined.
Constructors
sizeMax :: NonemptyList Term -> TCM Term Source #
Transform list of terms into a term build from binary maximum.
Viewing and unviewing sizes
data DeepSizeView Source #
A deep view on sizes.
Instances
Show DeepSizeView Source # | |
Defined in Agda.TypeChecking.Monad.SizedTypes showsPrec :: Int -> DeepSizeView -> ShowS # show :: DeepSizeView -> String # showList :: [DeepSizeView] -> ShowS # | |
Pretty DeepSizeView Source # | |
Defined in Agda.TypeChecking.Monad.SizedTypes pretty :: DeepSizeView -> Doc Source # prettyPrec :: Int -> DeepSizeView -> Doc Source # prettyList :: [DeepSizeView] -> Doc Source # |
data SizeViewComparable a Source #
Instances
Functor SizeViewComparable Source # | |
Defined in Agda.TypeChecking.Monad.SizedTypes fmap :: (a -> b) -> SizeViewComparable a -> SizeViewComparable b # (<$) :: a -> SizeViewComparable b -> SizeViewComparable a # |
sizeViewComparable :: DeepSizeView -> DeepSizeView -> SizeViewComparable () Source #
sizeViewComparable v w
checks whether v >= w
(then Left
)
or v <= w
(then Right
). If uncomparable, it returns NotComparable
.
sizeViewSuc_ :: QName -> DeepSizeView -> DeepSizeView Source #
sizeViewPred :: Nat -> DeepSizeView -> DeepSizeView Source #
sizeViewPred k v
decrements v
by k
(must be possible!).
sizeViewOffset :: DeepSizeView -> Maybe Offset Source #
sizeViewOffset v
returns the number of successors or Nothing when infty.
removeSucs :: (DeepSizeView, DeepSizeView) -> (DeepSizeView, DeepSizeView) Source #
Remove successors common to both sides.
unDeepSizeView :: DeepSizeView -> TCM Term Source #
View on sizes where maximum is pulled to the top
type SizeMaxView = NonemptyList DeepSizeView Source #
type SizeMaxView' = [DeepSizeView] Source #
maxViewMax :: SizeMaxView -> SizeMaxView -> SizeMaxView Source #
maxViewCons :: DeepSizeView -> SizeMaxView -> SizeMaxView Source #
maxViewCons v ws = max v ws
. It only adds v
to ws
if it is not
subsumed by an element of ws
.
sizeViewComparableWithMax :: DeepSizeView -> SizeMaxView -> SizeViewComparable SizeMaxView' Source #
sizeViewComparableWithMax v ws
tries to find w
in ws
that compares with v
and singles this out.
Precondition: v /= DSizeInv
.
maxViewSuc_ :: QName -> SizeMaxView -> SizeMaxView Source #