- = newSysLocalDs the_prim_arg_ty `thenDs` \ prim_arg ->
- returnDs (Var prim_arg,
- \ body -> Case arg (AlgAlts [(box_data_con,[prim_arg],body)]
- NoDefault)
- )
- -- ... continued below ....
-\end{code}
-
-As an experiment, I'm going to unpack any "acceptably small"
-enumeration. This code will never get used in the main version
-because enumerations would have triggered type errors but I've
-disabled type-checking in my version. ADR
-
-To Will: It might be worth leaving this in (but commented out) until
-we decide what's happening with enumerations. ADR
-
-\begin{code}
-#if 0
- -- MAYBE LATER:
- -- Data types with a nullary constructors (enumeration)
- | isEnumerationType arg_ty && -- enumeration
- (length data_cons) <= 5 -- "acceptably short"
- = newSysLocalDs the_prim_arg_ty `thenDs` \ prim_arg ->
-
- let
- alts = [ (con, [], mkMachInt i) | (con,i) <- data_cons `zip` [0..] ]
- arg_tag = Case arg (AlgAlts alts) NoDefault
- in
-