Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell "libraries"

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?

like image 274
Clinton Avatar asked Nov 12 '12 07:11

Clinton


People also ask

Does Haskell have libraries?

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'.

What is Hackage in Haskell?

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).


1 Answers

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.

like image 119
dsign Avatar answered Oct 17 '22 07:10

dsign