Home
Publications
Software
Center
Home
Courses
People
Projects
Page
Edit Page
Rename Page
Attach File
Printable
Wiki Source
More ...
Web
Recent Changes
Notify Service
News
Page Index
Search
More ...
Wiki
About TWiki
Text Formatting
Registration
Change Password
Reset Password
Users
Groups
Log In
or
Register
GHType Inference
Alexey
<!-- * Set PREV_SKIN = customtitle * Set CUSTOMTOPICTITLE = Type Inference for Generic Haskell * Set CUSTOMHEADTITLE = Type Inference for Generic Haskell * Set WEBTITLE = --> Currently, Generic Haskell requires explicit specification of generic functions. This page documents the ongoing effort to add type inference to the Generic Haskell compiler. ---++Prototype This is an implementation prototype for the algorithm described in [[Type Inference for Generic Haskell]]. The prototype has been tested with GHC 6.4 . ---+++Obtaining and building To obtain the prototype you need to invoke [[http://darcs.net][darcs]] as follows: <verbatim> darcs get http://www.cs.uu.nl/~alexey/repos/GH-type-infer/ </verbatim> To compile the prototype you need to install the parser combinators distributed with the [[HUT.WebHome][Haskell Utrecht Tools]] library. To build the prototype, simply type make: <verbatim> make </verbatim> ---+++Running the prototype You can take a look at the examples in the test directory. Examples for generic equality: <verbatim> $ ./mygh -d 5 -i tests/Eq.ghs (line 3, column 9)*4* (line 3, column 9) Generic scheme for eq is {|G_a|} G_a->G_a->Bool) (line 16, column 4)Type : => (List Int)->Bool </verbatim> Example for reduce function: <verbatim> $ ./mygh -d 5 -i tests/reduce2.ghs (line 1, column 9)*4* (line 1, column 9) Generic scheme for reduce is {|G_a|} forAll a69.a69->G_a->a69) (line 12, column 4)Type : => M_a70->Bool->M_a70 </verbatim> In the two examples above, we ran the frontend with a debug level option of 5 (-d 5). That is the level for printing the types of all the program bindings. Additionally, you will notice a construct in the programs used for type inspection. *Note*: The prototype currently lacks the simplifier function. As a consequence some corner cases are not typeable. A new version is in preparation. ---++Technical report The technical report may be downloaded from [[Type Inference for Generic Haskell]]. -- Main.AlexeyRodriguez - 14 Oct 2005