For example: in this repo, https://github.com/evancz/elm-architecture-tutorial/ , how do I load one of the Elm files into elm repl, so I can evaluate functions, look at type signatures, etc ?
In Haskell I would use :l
Unfortunately the examples on the GitHub link don't expose anything, so you cannot import from them as-is. Since you have access to source code you can of course modify the sources to support this, so read on :)
In general, it is done in repl by using command import
import SomeModule exposing (fun1, fun2)
SomeModule
is the name of the module where to import, and fun1
and fun2
are functions to import. For importing all functions, use (..)
When the repl is started in the same folder as the modules, the import works. Maybe there's some option for repl to set the sources directory, but I could not find it.
But for something to be imported from a module, it needs to export it in the source file, like this for example
module SomeModule exposing (fun1, fun2)