- combine (acc_fi, acc_fe, acc_h, acc_c) fo@(ForeignDecl i imp_exp _ ext_nm cconv _)
- | isForeignImport = -- foreign import (dynamic)?
- dsFImport i (idType i) uns ext_nm cconv `thenDs` \ bs ->
- returnDs (bs ++ acc_fi, acc_fe, acc_h, acc_c)
- | isForeignLabel =
- dsFLabel i ext_nm `thenDs` \ b ->
- returnDs (b:acc_fi, acc_fe, acc_h, acc_c)
- | isDynamicExtName ext_nm =
- dsFExportDynamic i (idType i) mod_name ext_nm cconv `thenDs` \ (fi,fe,h,c) ->
- returnDs (fi:acc_fi, fe:acc_fe, h $$ acc_h, c $$ acc_c)
-
- | otherwise = -- foreign export
- dsFExport i (idType i) mod_name ext_nm cconv False `thenDs` \ (fe,h,c) ->
- returnDs (acc_fi, fe:acc_fe, h $$ acc_h, c $$ acc_c)
- where
- isForeignImport =
- case imp_exp of
- FoImport _ -> True
- _ -> False
-
- isForeignLabel =
- case imp_exp of
- FoLabel -> True
- _ -> False
-
- (FoImport uns) = imp_exp
+ combine (acc_feb, acc_f, acc_h, acc_c) (ForeignImport id _ spec _)
+ = dsFImport mod_name id spec `thenDs` \ (bs, h, c) ->
+ returnDs (acc_feb, bs ++ acc_f, h $$ acc_h, c $$ acc_c)