disco-lang/disco

Load standard library modules immediately on startup

Closed this issue · 1 comments

Right now, this happens:

Disco> :doc append
No documentation found for 'append'.
Disco> 1
1
Disco> :doc append
append : List(a) × List(a) → List(a)

Append two lists into a single list.

This is because standard libraries get loaded only as a side effect of processing entered code. In theory, though, we should be able to e.g. just call loadParsedDiscoModule with an empty module immediately when starting the REPL, maybe right before calling loop in discoMain:

unless batch loop

Actually that was the wrong place (we need to call loadParsedDiscoModule earlier so that the standard library will be loaded even for batch processing things), but the principle is correct.