ordo icon indicating copy to clipboard operation
ordo copied to clipboard

Support something similar to . and : from lua

Open FrankBro opened this issue 5 years ago • 0 comments

Since some records might have something similar fields that would be similar to members in F#, we might want a notation to allow calling the member of a record with the record itself being passed as the first argument, similar to the way . and : works in lua.

For example

let record = { a = 1, b = 2, add = fun r -> r.a + r.b }

let list_of_records = (* something *)

list_of_records
|> List.map (fun record -> record.add)
(* bad *)

list_of_records
|> List.map (.add)

FrankBro avatar Jan 18 '19 22:01 FrankBro