     toBool $ unsafePerformIO $
         {# call caps_is_always_compatible #} caps1 caps2
 
+-- | Returns 'True' if all caps represented by the first argument are
+--   also represented by the second.
+--   
+--   This function does not work reliably if optional properties for
+--   caps are included on one caps and omitted on the other.
 capsIsSubset :: Caps
              -> Caps
              -> Bool

        {# call caps_subtract #} caps1 caps2 >>=
            takeCaps

capsNormalize :: Caps
              -> Caps
capsNormalize caps =
    unsafePerformIO $
        {# call caps_normalize #} caps >>= takeCaps

capsToString :: Caps
             -> String
capsToString caps =
    unsafePerformIO $
        {# call caps_to_string #} caps >>= readUTFString

capsFromString :: String
               -> Caps
capsFromString string =
    unsafePerformIO $
        withUTFString string {# call caps_from_string #} >>=
            takeCaps

newtype CapsM a = CapsM (CapsMRep a)
type CapsMRep a = (Caps -> IO a)

instance Monad CapsM where
    (CapsM aM) >>= fbM =
        CapsM $ \caps ->
            do a <- aM caps
               let CapsM bM = fbM a
               bM caps
    return a = CapsM $ const $ return a

marshalCapsModify :: IO (Ptr Caps)
                  -> CapsM a

  capsNormalize,
  capsFromString,
  capsToString,

-- * Caps Mutation
  CapsM,
  capsCreate,
  capsModify,
  capsAppendStructure,
  capsMergeStructure,
  capsRemoveStructure,
