Skip to content

Instantly share code, notes, and snippets.

@gsg
Created October 30, 2016 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsg/565422690378cd82f5c2c375a7890948 to your computer and use it in GitHub Desktop.
Save gsg/565422690378cd82f5c2c375a7890948 to your computer and use it in GitHub Desktop.
type x_part = [`X of int]
type pre = [x_part | `Pcon of pre * pre];;
let rec pcon_to_lstm (arg: pre) : ([`X of int]) list =
match arg with
| `Pcon (a, b) -> (pcon_to_lstm a) @ (pcon_to_lstm b)
| (#x_part as x) -> [x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment