简体   繁体   中英

How to enable hints and warnings in the online REPL

I figured that I can do it on the command line REPL like so:

java -jar frege-repl-1.0.3-SNAPSHOT.jar -hints -warnings

But how can I do the same in http://try.frege-lang.org

Hints and warnings are already enabled by default. For example,

frege> f x = f x
function f :: α -> β
3: application of f will diverge.

Perhaps we can make it better by explicitly saying it as warning or hint (instead of colors distinguishing them) something like:

[Warning] 3: application of f will diverge.

and providing an option to turn them on/off.

Update: There was indeed an issue (Thanks Ingo for pointing that out!) with showing warnings that are generated in a later phase during the compilation. This issue has been fixed and the following examples now correctly display warnings in the REPL:

frege> h x = 0; h false = 42
function h :: Bool -> Int
4: equation or case alternative cannot be reached.

frege> f false = 6
function f :: Bool -> Int
5: function pattern is refutable, consider
adding a case for true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM