I think the code should explain it better:
    
    
    import options
    
    let maybe = some[bool](true)
    
    case maybe:
      of true:
        echo "true"
      of false:
        echo "false"
      of none[bool]():
        echo "none"
    
    
    
    Run

The compiler complains that maybe must be an ordinal type.

I want to emulate something like this:
    
    
    fn main() {
        let maybe: Option<bool> = None;
        match maybe {
            Some(true) => println!("true"),
            Some(false) => println!("false"),
            None => println!("None")
        }
    }
    
    
    Run

Reply via email to