Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IF

IF extends ZERO with conditional expressions:

if zero?(0) then 2 else 3

A conditional evaluates its condition first, then uses the resulting Boolean value to choose which branch to evaluate. The other branch remains unevaluated.

That means this program succeeds:

if zero?(0) then 2 else -(zero?(0), 1)

even though the else branch would produce a runtime type error if it were evaluated.

For a closer look, read IF: Conditional Expressions and Selective Evaluation.

To try it, you'll need Nix with flakes enabled.

nix develop
elm repl

Then:

import IF.Interpreter as I

I.run "if zero?(0) then 2 else 3"
-- Ok (VNumber 2)

About

IF extends ZERO with conditional expressions, using Boolean values to choose which branch to evaluate.

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages