Haskell : loading ALL files in current directory path

后端 未结 2 1815
执念已碎
执念已碎 2020-12-21 00:16

The command (in GHCi)

:load abc

Loads the functions in the file abc (which must exist in the current directory path). How would I load all

2条回答
  •  旧时难觅i
    2020-12-21 00:36

    Presumably you mean Haskell source files, because you can't use the :load command in GHCi for anything else.

    At the top of the source file that you load, include the line:

    import NecessaryModule

    For each of the source files, make sure to name the modules, e.g.,

    module NecessaryModule where

    should appear. GHCi will automatically link all the files.

    If you're trying to import data, take a look at System.Directory in the documentation.

提交回复
热议问题