idris-lang / Idris-dev

A Dependently Typed Functional Programming Language
http://idris-lang.org
Other
3.43k stars 644 forks source link

Add concept of an installation data directory #3141

Open colin-adams opened 8 years ago

colin-adams commented 8 years ago

1) Add datadir = to ipkg files 2) Installing the package will recursively copy all files in the location specified by datadir to a location parallel to (?) the location where it installs the executable 3) A module should be able to find out where it's packages data directory is

The motiviation is that you can install a program that needs data files (for example, an example program in a web server library might need to look for static html or png files).

colin-adams commented 8 years ago

I intend to do this at some point in the indefinite future.

david-christiansen commented 8 years ago

It would be great if this path were also available to the documentation system. This would let us include images and other resources in docstrings, or even include a manual and link from the string to the relevant section.

Melvar commented 8 years ago

If some language feature is added for 3), then package organization suddenly becomes important to the language itself, rather than merely a feature of the external build system.

colin-adams commented 8 years ago

Melvar, a fair point. Maybe it can be done just as a library function though. I don't know.

colin-adams commented 8 years ago

Cabal does it (well it has data files rather than data directory - I personally need the latter - we could have both) by writing a module containing a function. We could do the same - idris --build would have to generate the module prior to type checking.