I have a source code below. I don't understand its syntax.
[g | t <- ts; g <- symbols t]
is very strange. Please help me to explain it or recommend any books or documents which correlates to it. Thank you very much
type term = V of string | F of string * term list
let rec symbols = function
| V x -> [x]
| F (f, ts) -> f :: [ g | t <- ts; g <- symbols t ]
let rec functions = function
| V _ -> []
| F (f, ts) -> f :: [ g | t <- ts; g <- functions t ]