WebHome
-
UHC
-
EHC
-
Documentation
-
Features & Status
-
EH examples
-
Feedback
-
News
-
FAQ
Related
-
Ruler
-
Shuffle
-
uulib & uuagc
Old Stuff
-
Previous WebHome
-
AFP2004
Center
Master Program
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
Library Structure
Ehc
---++ Guideline to libraries structure in UHC. The UHC libraries structure closely follows the GHC libraries structure. However since GHC supports more extensions than UHC there might be differences. ---+++ UHC libraries modules: UHC libraries have 3 types of modules: * =UHC specific= - written from scratch for UHC * =GCH modified= - copied from GHC and modified according to UHC needs, but keeping the original interface. * =GHC unmodified= - plain copy of the corresponding GHC variant. Which files are copied can be seen by inspected the content of $UHC$/ehclib/files2.mk, where $UHC$ is the root directory for UHC distribution. The reference source code for the GHC library is [[%ATTACHURL%/ghc-6.10.1.20090106-src.tar.bz2][ghc-6.10.1.20090106]]. ---+++ Adding modules to a library New modules are added to a library by following the steps: 1. If the new module (or its equivalent) already exists in GHC libraries we try to import it from there. If everything works fine, i.e. it compiles and the functions produce the expected results, then we're done. Go to testing phase. Note that if the import works directly there is no need to actually copy the module files; we only modify the [[Library config file][$UHC$/ehclib/files2.mk]] by adding the corresponding entries. 1. If the direct import doesn't work then we physically copy the module to the library structure, following the original GHC structure. Next, the module is modified so it will work in the UHC context (don't forget to document the changes). 1. If it is a completely new module which doesn't exists in GHC, we add it in the most appropriate place. 1. [Test Phase] Add [[Testing UHC][tests]] to verify the new module. During modifications we may encounter a situation where we have to use a function _f_, already defined in another UHC specific module, say _UHC.M_, but which is not exported. The guideline for this is: 1. Modify _UHC.M_ interface by exporting the function _f_. 1. If the above action creates a cycle dependency then abstract the function(s) we need (and only them) into a separate module and import this new module into _UHC.M_, as well as where we it is needed. 1. Never modify the interface of a module which was only copied-modified from GHC. If this is the case then it's a good indication that the module should be made UHC specific. -- Main.AtzeDijkstra - 25 Feb 2010
Topic attachments
I
Attachment
Action
Size
Date
Who
Comment
bz2
ghc-6.10.1.20090106-src.tar.bz2
manage
2842.1 K
26 Feb 2010 - 12:58
CalinJuravle
Reference source code for library