Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Compatibility Modules
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Worked example = Let's work out how this will play out for our fictitious <code>parseInt</code> example above. base 4.6 contains the Parse module which is about to change, so we must create a package base-compat-4_6 containing a single module, defined as such: <pre>module Parse.Compat (module Parse) where import Parse</pre> This can be uploaded to Hackage, and users can immediately transition to using Parse.Compat anywhere they would have used Parse. Eventually, it comes time for the new GHC release, so we need to update base-compat-4_6 to support the new Parse API using conditional compilation. This would look something like: <pre>{-# LANGUAGE CPP #-} #if MIN_VERSION_base(4, 7, 0) module Parse.Compat (module Parse, parseInt) where import Parse hiding (parseInt) import qualified Parse parseInt :: String -> Int parseInt = Parse.parseInt 0 #else module Parse.Compat (module Parse) where import Parse #endif</pre> This can be uploaded to Hackage before the GHC release is made, and then users of the compatibility package will be completely insulated from the GHC upgrade. In sum: * Initial release of base-compat-4_6 version 1.0.0 would only depend on base 4.6, and be a pass-through shim. * When we're about to make the GHC 7.8 release, we at that point release base-compat-4_6 version 1.0.1, which includes base 4.7 support. ** The only change here would be if someone in the community volunteers to add the base 4.7 support earlier in order to ease GHC HEAD testing. * The only changes to be made to this package in the future would be: ** Bug fixes. ** Support for future base versions. * At no point would there ''ever'' be a breaking API change of this package. In other words, the versions released will always be <= 1.1.
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width