Record type pattern matching in Ocaml

后端 未结 1 617
逝去的感伤
逝去的感伤 2020-12-17 14:30

I\'m trying to use pattern matching to write a calculator application.

Two major types defined as below:

type key = Plus | Minus | Multi | Div | Equa         


        
相关标签:
1条回答
  • 2020-12-17 14:59

    A record pattern looks like a record:

    match s with
    | { lcd = a; vpr = d; _ } -> (* Expression *)
    
    0 讨论(0)
提交回复
热议问题