how to release a module in Haskell that can be used in another program?

Viewed 155

I'm a beginner of Haskell, and I got a question here, how to release or build a module which can be used in another program ? For example, when I use Java, I can write some classes, some functions and make it to be a jar that can be use in another program. So , how does this go with Haskell? Is there necessary to use the same functions, modules with the source code ? And thanks.

1 Answers
  • If you're fine with sharing your library and its source code with everyone, it is common to upload it to Hackage. Other projects built with any common Haskell build tool know how to interface with Hackage packages

  • If you want to selectively share your library and its source code, you can upload it to a private or public github repository, and it could be used as a stack dependency

  • If you want to share the library locally with yourself, stack supports depending on local paths

  • If you wish to share your library without sharing source code, you can expose a C-api and make a DLL

Related