Plain Text Paste by Ocaml types
Description: None
Hide line numbers

Create new paste
Post a reply
View replies

Paste:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
type oexpr =
| OPlane of int*int
| OSphere of int*int*int;;

type instruction =
| Put of oexpr
| Assign of string*expr;;

Now I want to match on OPlane or OSphere:

let func instructions = match instructions with
| [] -> ()
| a::b -> match a with
       | Put exp -> match exp with
              | OPlane -> ()
              | OSphere -> ();;

Replies:
No replies posted yet