In C, one can split code into a "header file" and implementation, compile the implementation, and then just distribute the compiled version and the header only (not the full source).
Is this possible in Haskell?
On top of the Core Libraries, the Haskell Platform comes preinstalled with some additional packages that together form the Haskell Platform libraries. These libraries have been thoroughly tested before being included. The addition of these libraries with the Haskell Platform is what makes it 'batteries included'.
Hackage is the Haskell community's central package archive of open source software. Hackage has been online since January 2007 and is constantly growing. You can publish libraries and programs or download and install packages with tools like cabal-install (or via your distro's package manager).
GHC allows for that, but of course your code will be tied to a specific binary platform.
Check here:
http://www.haskell.org/ghc/docs/2.10/users_guide/user_174.html
or for a more updated explanation:
http://www.haskell.org/ghc/docs/7.0.3/html/users_guide/separate-compilation.html
In particular, look for .hi files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With