-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Type-indexed runtime-checked properties
--
-- This package provides a (phantom) type-indexed newtype
-- evidence-wrapper for values that are checked to satisfy the property
-- associated with the type.
@package data-checked
@version 0.2
-- | Type-indexed runtime-checked properties.
module Data.Checked
-- | Wrapper-evidence for property p.
data Checked p v
-- | Use when the property can be deduced without a runtime check.
trustMe :: v -> Checked p v
-- | Use when the property can be deduced without a runtime check.
trustThat :: p -> v -> Checked p v
-- | Apply a fuction that preserves the property to the checked value.
trustMap :: (v -> v) -> Checked p v -> Checked p v
-- | Unwrap the checked value.
checked :: Checked p v -> v
class Property p v
holds :: Property p v => p -> v -> Bool
-- | Return Just v if p holds and Nothing
-- overwise.
maybeHolds :: Property p v => p -> v -> Maybe v
-- | Wrap the value if the property holds.
check :: Property p v => v -> Maybe (Checked p v)
instance Typeable2 Checked
instance NFData v => NFData (Checked p v)