Closed jwaldmann closed 11 years ago
fixed in https://github.com/apunktbau/co4/commit/7850bb873f170f508f98f6492245628d0bc2c557
The line you mentioned is actually correct (and efficent), but
uNat w = constructors $ replicate (2^w) $ Just []
is not, as it builds huge allocators for data with many constructors.
This commit introduces a special allocator BuiltIn n
that simply allocates an EncodedAdt
with n
flags and no arguments.
Test case: https://github.com/apunktbau/co4/blob/master/CO4/Test/Factor.hs constains simple binary multiplication.
Obeserved behaviour: eats huge amount of space (try replacing 24 by 32 also).
This seems terribly wrong: https://github.com/apunktbau/co4/blob/master/CO4/PreludeNat.hs#L50
since it seems to iterate over 2^24 values.
This inefficiency is hidden for the lower bit widths that we usually have (<= 8) but it should be fixed.