     toBool $ unsafePerformIO $
         {# call caps_is_subset #} caps1 caps2
 
+-- | Creates a new caps containing all the formats that are common to
+--   both of the caps.
 capsIntersect :: Caps
-             -> Caps
-             -> Caps
+              -> Caps
+              -> Caps
 capsIntersect caps1 caps2 =
     unsafePerformIO $
         {# call caps_intersect #} caps1 caps2 >>=
             takeCaps
 
+-- | Creates a new caps containing all the formats that are common to
+--   either of the caps. If either of the structures are equivalient
+--   to 'capsAny', the result will be 'capsAny'.
 capsUnion :: Caps
           -> Caps
           -> Caps

    toBool $ unsafePerformIO $
        {# call caps_is_always_compatible #} caps1 caps2

capsIsSubset :: Caps
             -> Caps
             -> Bool

{# context lib = "gstreamer" prefix = "gst" #}

import Control.Monad (liftM)
import Control.Monad.Reader
import System.Glib.FFI
import System.Glib.UTFString
{#import Media.Streaming.GStreamer.Core.Types#}

-- | A 'Caps' that represents an undefined media type.
capsNone :: Caps
capsNone =
    unsafePerformIO $ {# call caps_new_empty #} >>= takeCaps

-- | A 'Caps' that represents all possible media types.
capsAny :: Caps
capsAny =
    unsafePerformIO $ {# call caps_new_any #} >>= takeCaps

-- | Returns the number of structures contained in the 'Caps'.
capsSize :: Caps
         -> Word
capsSize caps =
    fromIntegral $ unsafePerformIO $ {# call caps_get_size #} caps

-- | Returns the 'Structure' at the given index.
capsGetStructure :: Caps
                 -> Word
                 -> Maybe Structure
