Agda-2.5.2: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.Utils.Pointer

Synopsis

- data Ptr a
- newPtr :: a -> Ptr a
- derefPtr :: Ptr a -> a
- setPtr :: a -> Ptr a -> Ptr a
- updatePtr :: (a -> a) -> Ptr a -> Ptr a
- updatePtrM :: Functor f => (a -> f a) -> Ptr a -> f (Ptr a)

# Documentation

data Ptr a #

Instances

Functor Ptr # |
Methods fmap :: (a -> b) -> Ptr a -> Ptr b # (<$) :: a -> Ptr b -> Ptr a #
Foldable Ptr # |
Methods fold :: Monoid m => Ptr m -> m # foldMap :: Monoid m => (a -> m) -> Ptr a -> m # foldr :: (a -> b -> b) -> b -> Ptr a -> b # foldr' :: (a -> b -> b) -> b -> Ptr a -> b # foldl :: (b -> a -> b) -> b -> Ptr a -> b # foldl' :: (b -> a -> b) -> b -> Ptr a -> b # foldr1 :: (a -> a -> a) -> Ptr a -> a # foldl1 :: (a -> a -> a) -> Ptr a -> a # toList :: Ptr a -> [a] # null :: Ptr a -> Bool # length :: Ptr a -> Int # elem :: Eq a => a -> Ptr a -> Bool # maximum :: Ord a => Ptr a -> a # minimum :: Ord a => Ptr a -> a # sum :: Num a => Ptr a -> a # product :: Num a => Ptr a -> a #
Traversable Ptr # |
Methods traverse :: Applicative f => (a -> f b) -> Ptr a -> f (Ptr b) # sequenceA :: Applicative f => Ptr (f a) -> f (Ptr a) # mapM :: Monad m => (a -> m b) -> Ptr a -> m (Ptr b) # sequence :: Monad m => Ptr (m a) -> m (Ptr a) #
Eq (Ptr a) # |
Methods (==) :: Ptr a -> Ptr a -> Bool # (/=) :: Ptr a -> Ptr a -> Bool #
Ord (Ptr a) # |
Methods compare :: Ptr a -> Ptr a -> Ordering # (<) :: Ptr a -> Ptr a -> Bool # (<=) :: Ptr a -> Ptr a -> Bool # (>) :: Ptr a -> Ptr a -> Bool # (>=) :: Ptr a -> Ptr a -> Bool # max :: Ptr a -> Ptr a -> Ptr a # min :: Ptr a -> Ptr a -> Ptr a #
Show a => Show (Ptr a) # |
Methods showsPrec :: Int -> Ptr a -> ShowS # show :: Ptr a -> String # showList :: [Ptr a] -> ShowS #
NFData (Ptr a) # |
Methods rnf :: Ptr a -> () #
Hashable (Ptr a) # |
Methods hashWithSalt :: Int -> Ptr a -> Int # hash :: Ptr a -> Int #
TermLike a => TermLike (Ptr a) # |
Methods traverseTerm :: (Term -> Term) -> Ptr a -> Ptr a # traverseTermM :: Monad m => (Term -> m Term) -> Ptr a -> m (Ptr a) # foldTerm :: Monoid m => (Term -> m) -> Ptr a -> m #
AbsTerm a => AbsTerm (Ptr a) # |
Methods absTerm :: Term -> Ptr a -> Ptr a #

newPtr :: a -> Ptr a #

derefPtr :: Ptr a -> a #

setPtr :: a -> Ptr a -> Ptr a #

updatePtr :: (a -> a) -> Ptr a -> Ptr a #

updatePtrM :: Functor f => (a -> f a) -> Ptr a -> f (Ptr a) #

If `f a` contains many copies of `a` they will all be the same pointer in the result. If the function is well-behaved (i.e. preserves the implicit equivalence, this shouldn't matter).