darcs-beta-2.4.98.5: a distributed, interactive, smart revision control systemSource codeContentsIndex
Darcs.Witnesses.Sealed
Synopsis
data Sealed a where
Sealed :: a -> Sealed a
seal :: a -> Sealed a
unseal :: (a -> b) -> Sealed a -> b
mapSeal :: (a -> b) -> Sealed a -> Sealed b
unsafeUnseal :: Sealed a -> a
unsafeUnsealFlipped :: FlippedSeal a -> a
unsafeUnseal2 :: Sealed2 a -> a
data Sealed2 a where
Sealed2 :: !a -> Sealed2 a
seal2 :: a -> Sealed2 a
unseal2 :: (a -> b) -> Sealed2 a -> b
mapSeal2 :: (a -> b) -> Sealed2 a -> Sealed2 b
data FlippedSeal a where
FlippedSeal :: !a -> FlippedSeal a
flipSeal :: a -> FlippedSeal a
unsealFlipped :: (a -> b) -> FlippedSeal a -> b
mapFlipped :: (a -> b) -> FlippedSeal a -> FlippedSeal b
unsealM :: Monad m => m (Sealed a) -> (a -> m b) -> m b
liftSM :: Monad m => (a -> b) -> m (Sealed a) -> m b
class Gap w where
emptyGap :: p -> w p
freeGap :: p -> w p
joinGap :: (p -> q -> r) -> w p -> w q -> w r
data FreeLeft p
unFreeLeft :: FreeLeft p -> Sealed p
data FreeRight p
unFreeRight :: FreeRight p -> FlippedSeal p
Documentation
data Sealed a whereSource
Constructors
Sealed :: a -> Sealed a
show/hide Instances
MyEq a => Eq (Sealed a)
Show1 a => Show (Sealed a)
seal :: a -> Sealed aSource
unseal :: (a -> b) -> Sealed a -> bSource
mapSeal :: (a -> b) -> Sealed a -> Sealed bSource
unsafeUnseal :: Sealed a -> aSource
unsafeUnsealFlipped :: FlippedSeal a -> aSource
unsafeUnseal2 :: Sealed2 a -> aSource
data Sealed2 a whereSource
Constructors
Sealed2 :: !a -> Sealed2 a
show/hide Instances
Show2 a => Show (Sealed2 a)
seal2 :: a -> Sealed2 aSource
unseal2 :: (a -> b) -> Sealed2 a -> bSource
mapSeal2 :: (a -> b) -> Sealed2 a -> Sealed2 bSource
data FlippedSeal a whereSource
Constructors
FlippedSeal :: !a -> FlippedSeal a
flipSeal :: a -> FlippedSeal aSource
unsealFlipped :: (a -> b) -> FlippedSeal a -> bSource
mapFlipped :: (a -> b) -> FlippedSeal a -> FlippedSeal bSource
unsealM :: Monad m => m (Sealed a) -> (a -> m b) -> m bSource
liftSM :: Monad m => (a -> b) -> m (Sealed a) -> m bSource
class Gap w whereSource
Gap abstracts over FreeLeft and FreeRight for code constructing these values
Methods
emptyGap :: p -> w pSource
An empty Gap, e.g. NilFL or NilRL
freeGap :: p -> w pSource
A Gap constructed from a completely polymorphic value, for example the constructors for primitive patches
joinGap :: (p -> q -> r) -> w p -> w q -> w rSource
Compose two Gap values together, e.g. 'joinGap (+>+)' or 'joinGap (:>:)'
show/hide Instances
data FreeLeft p Source
'FreeLeft p' is 'forall x . exists y . p x y' In other words the caller is free to specify the left witness, and then the right witness is an existential. Note that the order of the type constructors is important for ensuring that y is dependent on the x that is supplied. This is why Stepped is needed, rather than writing the more obvious 'Sealed (Poly p)' which would notionally have the same quantification of the type witnesses.
show/hide Instances
unFreeLeft :: FreeLeft p -> Sealed pSource
Unwrap a FreeLeft value
data FreeRight p Source
'FreeLeft p' is 'forall y . exists x . p x y' In other words the caller is free to specify the right witness, and then the left witness is an existential. Note that the order of the type constructors is important for ensuring that x is dependent on the y that is supplied.
show/hide Instances
unFreeRight :: FreeRight p -> FlippedSeal pSource
Unwrap a FreeRight value
Produced by Haddock version 2.6.1