+-- wrap up an unboxed value.
+wrapUnboxedValue :: Type -> DsM (Type, Id, CoreExpr)
+wrapUnboxedValue ty
+ | null data_cons
+ -- oops! can't see the data constructors
+ = can'tSeeDataConsPanic "result" ty
+ -- Data types with a single constructor, which has a single, primitive-typed arg
+ | (maybeToBool maybe_data_type) && -- Data type
+ (null other_data_cons) && -- Just one constr
+ not (null data_con_arg_tys) && null other_args_tys && -- Just one arg
+ isUnLiftedType the_prim_result_ty -- of primitive type
+ =
+ newSysLocalDs the_prim_result_ty `thenDs` \ prim_result_id ->