Quick actions

cmd+k|ctrl+k

Navigation

Languages

ATS case- with guard error

Snippet info

Language

Ats

Visibility

public

Author

steinwaywhw

Created

2016-10-07T20:52:39Z

Updated

2016-10-07T20:52:46Z

#include "share/atspre_staload.hats"

datatype Option =
| OpSome of int
| OpNone 


implement main0 () = let 

    fun test (o: Option): int = 
        case- o of
        | OpSome n when n > 0 => n
        
    val _ = println! (test (OpSome ~1))

in 
    
end
INFO