Let genApplication handle (built-in) enumeration types.
Since datacons are no longer seen as local variables, genApplication
sees simple datacons without arguments (e.g., x = True). Now it knows
how to handle these.
This ensures that datacon id's get simplified like they should.
Previously, this wasn't really needed, since a datacon id would become a
constant that could be used in conditional assignments directly. Now,
however, there might be more complex ADT's (like the Maybe type), where
one of the constructors is without arguments (e.g., Nothing), but
assigning the enumeration value directly won't work (it should go into
the constructor field).
Add support for multiple-constructor datatypes with fields.
This is the naïve implementation that will not try to use the same
storage space for fields from different constructors, so it might
quickly become inefficient with bigger datatypes. For simple types like
the Maybe type, this should be fine.
The support is not quite working yet, for some reason these new types
are not marked as representable. This is cause because the type
substitution in mkTyConHType does not work for some reason, so the field
type of the Just constructor in (for example) a Maybe Bool type stays
"a" instead of "Bool".
Merge branch 'master' of git://github.com/christiaanb/clash
* 'master' of git://github.com/christiaanb/clash:
Do not be overzealous with inlining results of polymorphic functions
Do not function extract functions that still have free type variables
Add setup file
Fix cabal file to reflect temp bug fixes
Temporarily disable "inlinenonrepresult" transformation, and apply eta-expansion transformation to all expressions
Rename cλash dir to clash so it behaves well within the ghc build tree
update cabal file to upload to hackage
Remove defunct makeVHDLStrings function, messes with haddock
Update reducer to use new integer types
Reflect moving TFVec and TFP Integers into clash in sourcefiles related to builtin types
Update package dependencies
Move TFVec and TFP integers (Signed, Unsiged and Index) into clash
Previously, if the scrutinee was a variable reference, it would not be
simplified, skipping top level binders as scrutinees. Now only local
variable references are skipped.
Move the application of "everywhere" to dotransforms.
Since every transformation is now applied "everywhere", we don't need to
specify this for every transform. This allows us to change the
application order in the future.
Make top level inlining handle non-representable results gracefully.
Since it does not know (nor care) if the function result is
representable, it now uses splitNormalizedNonRep and checks if the
result is a Var afterwards.
Let binding inlining was not working properly when an to-be-inlined
binding used another to-be-inlined binding and they were inlined in the
wrong order (the result would be a reference to a no longer existing
binding).
Slightly move the "after normalization" debug output.
This should ensure it is always printed. Previously, it seems it was printed
only when the final state from the monad was accessed, not when the
value was used (which caused problems if the value caused an error
further on).
Inline all simple top level functions, not just compiler-generated ones.
The checking for compiler generated functions wasn't watertight, so
let's just don't check at all. There is no risk for loops with
funextract anymore, since we only inline functions applied in let
bindings now.
Only inline top level functions that are applied in a let binding.
This should limit the amount of inlinings that happen a bit, make sure
inlining is only done in later stages of inlining and only when it
actually helps to prevent useless components. This should help to
prevent loops with inlinedict, since dictionary arguments should never
be inlined anymore.
Christiaan Baaij [Sat, 20 Mar 2010 15:42:05 +0000 (16:42 +0100)]
Fix zipWith template to work with partially applied functions, add support for boolean negation, and update error message of classopresolution transformation
Restructure the top level inlining transformation.
It now checks to see if the original (non-normalized) body is already
simple and only resorts to normalizing if the original body isn't simple
already. This should speed things up a bit, also because inlining the
normalized body probably needs some extra cleanups.
Don't resolve class operations that are builtin functions.
We already have a fixed VHDL translation for these, and usually the
actual implementation is not translateable (for example, the derived Eq
instances translate dataconstructors to Int#'s and use GHC.Prim.==# to
compare them).
Let classoperationresolution handle partially inlined dictionaries.
Previously, if a dictionary argument was not yet an application of a
dataconstructor (e.g., completely inlined) but an application of a
polymorphic top level binder (e.g., $fsomething), then it would complain
about mismatching types.