- (maybe_ty, \e -> mkApps (Var (dataConWrapId data_con))
- (map Type tycon_arg_tys ++ [wrapper e]))
+ resultWrapper unwrapped_res_ty `thenDs` \ (maybe_ty, wrapper) ->
+ returnDs
+ (maybe_ty, \e -> mkApps (Var (dataConWrapId data_con))
+ (map Type tycon_arg_tys ++ [wrapper (narrow_wrapper e)]))
+
+ -- Strings; 'dotnet' only.
+ | Just (tc, [arg_ty]) <- maybe_tc_app, tc == listTyCon,
+ Just (cc,[]) <- splitTyConApp_maybe arg_ty, cc == charTyCon
+ = dsLookupGlobalId unmarshalStringName `thenDs` \ pack_id ->
+ returnDs (Just addrPrimTy,
+ \ e -> App (Var pack_id) e)
+
+ -- Objects; 'dotnet' only.
+ | Just (tc, [arg_ty]) <- maybe_tc_app,
+ tyConName tc == objectTyConName
+ = dsLookupGlobalId unmarshalObjectName `thenDs` \ pack_id ->
+ returnDs (Just addrPrimTy,
+ \ e -> App (Var pack_id) e)