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

Safe HaskellNone

Agda.Utils.Pointer

Synopsis

Documentation

data Ptr a

Instances

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).