import Maybes ( maybeToBool )
import PrelVals ( packStringForCId )
import PrimOp ( PrimOp(..) )
import Maybes ( maybeToBool )
import PrelVals ( packStringForCId )
import PrimOp ( PrimOp(..) )
import Type ( isUnpointedType, splitAlgTyConApp_maybe,
splitTyConApp_maybe, splitFunTys, splitForAllTys,
Type
import Type ( isUnpointedType, splitAlgTyConApp_maybe,
splitTyConApp_maybe, splitFunTys, splitForAllTys,
Type
mapAndUnzipDs unboxArg args `thenDs` \ (unboxed_args, arg_wrappers) ->
let
final_args = Var old_s : unboxed_args
mapAndUnzipDs unboxArg args `thenDs` \ (unboxed_args, arg_wrappers) ->
let
final_args = Var old_s : unboxed_args
= newSysLocalDs byteArrayPrimTy `thenDs` \ prim_arg ->
mkAppDs (Var packStringForCId) [VarArg arg] `thenDs` \ pack_appn ->
returnDs (Var prim_arg,
= newSysLocalDs byteArrayPrimTy `thenDs` \ prim_arg ->
mkAppDs (Var packStringForCId) [VarArg arg] `thenDs` \ pack_appn ->
returnDs (Var prim_arg,
maybe_arg2_tycon = splitTyConApp_maybe data_con_arg_ty2
Just (arg2_tycon,_) = maybe_arg2_tycon
maybe_arg2_tycon = splitTyConApp_maybe data_con_arg_ty2
Just (arg2_tycon,_) = maybe_arg2_tycon
-can't_see_datacons_error thing ty
- = pprPanic "ERROR: Can't see the data constructor(s) for _ccall_/_casm_ "
+can'tSeeDataConsPanic thing ty
+ = pprPanic "ERROR: Can't see the data constructor(s) for _ccall_/_casm_/foreign declaration"
(hcat [text thing, text "; type: ", ppr ty, text "(try compiling with -fno-prune-tydecls ..)\n"])
\end{code}
(hcat [text thing, text "; type: ", ppr ty, text "(try compiling with -fno-prune-tydecls ..)\n"])
\end{code}
-- Data types with a single constructor, which has a single, primitive-typed arg
| (maybeToBool maybe_data_type) && -- Data type
-- Data types with a single constructor, which has a single, primitive-typed arg
| (maybeToBool maybe_data_type) && -- Data type
-getIoOkDataCon :: Type -- IO t
- -> (Id,Type) -- Returns (IOok, t)
+getIoOkDataCon :: Type -- IO t
+ -> (Id, Id, Type) -- Returns (IOok, IO, t)
Just (io_result_tycon, _) = splitTyConApp_maybe io_result_ty
[ioOkDataCon,ioFailDataCon] = tyConDataCons io_result_tycon
in
Just (io_result_tycon, _) = splitTyConApp_maybe io_result_ty
[ioOkDataCon,ioFailDataCon] = tyConDataCons io_result_tycon
in