Quick actions

cmd+k|ctrl+k

Navigation

Languages

Templates and Closures in ATS

Snippet info

Language

Ats

Visibility

public

Author

steinwaywhw

Created

2018-05-03T23:53:38Z

Updated

2018-05-04T15:07:09Z

#include "share/atspre_staload.hats"

extern fun {} show (): void
implement  {} show () = println! "default"

extern fun {} test ( () -<cloref1> void ): void
implement  {} test (fx) = fx ()

implement main0 () = let 
    val fx = lam () =<cloref1> show<> ()
    fun {} fy = lam () => lam () =<cloref1> show<> ()
    
    val _ = test<> (fx)
    val _ = fx ()
    
    val _ = test<> (fy())
    val _ = fy () ()
    
    implement show<> () = println! "override"
    
    val _ = test<> (fx)
    val _ = fx ()
    
    val _ = test<> (fy())
    val _ = fy () ()
in 
   
end
INFO