Skip to content

Instantly share code, notes, and snippets.

@habib-sadullaev
Created September 20, 2020 17:43
Show Gist options
  • Save habib-sadullaev/0b687c0bc45498edf66a65762d23562b to your computer and use it in GitHub Desktop.
Save habib-sadullaev/0b687c0bc45498edf66a65762d23562b to your computer and use it in GitHub Desktop.
traverse Expr<'a> list into Expr<'a list>
let traverse (exprs: Expr<'a> list) =
let folder elem state = <@ %elem :: %state @>
let init = <@ [] @>
List.foldBack folder exprs init
[1..3] |> List.map (fun x -> <@ x @>) |> traverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment