Personally this syntax looks the best while also making a distinction between 
sum types and typical enums, _however_ , when it comes to pattern matching, I 
believe a separate `match` keyword would look nicer.
    
    
    # Assuming `some` is implemented with sum types in this example
    
    let strOpt = some("Foo")
    let strTupleOpt = some(("Bar", "Baz"))
    
    match strOpt
      of Some as foo:
        echo foo
      
      of None:
        discard
    
    match strTupleOpt
      of Some as (bar, baz):
        echo bar, ", ", baz
      
      of None:
        discard
    
    
    Run

Reply via email to