Static library to redefine entrypoint
gtener at gmail.com
Fri Apr 24 07:06:14 EDT 2009
Why not just tell them to import your library and do something like
> main = withSomeInit labMain
where "withSomeInit" is the function you provide? This approach is present
in some other libs that require initialization.
On Fri, Apr 24, 2009 at 12:56, Philip K.F. <p.k.f.holzenspies at utwente.nl>wrote:
> Dear GHCers,
> I am trying to write a wrapper library for lab work to give to students.
> My problem is, that the libraries I use require initialization that I
> really want to hide from our students. The wrapper I'm writing is
> compiled to a static library and installed with cabal, so students can
> just "ghc --make" or "ghci" their sources. Here comes the problem: I
> want to define main and let students just define labMain as an entry
> point to their program.
> How can I have my library use "labMain" without a definition? Keep in
> mind that I want to give them a cabalized library that they can just
> link to, so I can't give them a template file that they fill and compile
> together with my code. Is it at all possible to have "external"
> functions and letting the linker sort stuff out?
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glasgow-haskell-users