writeHandleType :: HandleType -> Write Doc
writeHandleType ht = 
  let cType = htCType ht
  in case cType of
       Ptr [] t@(TypeDef (Struct _)) -> writeDispatchableHandleType ht t
       t@(TypeDef (TypeName _)) -> writeNonDispatchableHandleType ht t
       t -> error ("Unhandled handle type " ++ show t ++
                   ", have more been added to the spec?")
writeHandleType :: HandleType -> Write Doc
writeHandleType ht = 
  let cType = htCType ht
  in case cType of
       Ptr [] t@(TypeDef (Struct _)) -> writeDispatchableHandleType ht t
       t@(TypeDef (TypeName _)) -> writeNonDispatchableHandleType ht t
       t -> error ("Unhandled handle type " ++ show t ++
                   ", have more been added to the spec?")
writeHandleType ht = 
  let cType = htCType ht
  in case cType of
       Ptr [] t@(TypeDef (Struct _)) -> writeDispatchableHandleType ht t
       t@(TypeDef (TypeName _)) -> writeNonDispatchableHandleType ht t
       t -> error ("Unhandled handle type " ++ show t ++
                   ", have more been added to the spec?")