map - Erlang list of tuples with another list of tuples inside to a single list -


So, I'm searching for a better way to do this.

Incoming data is something like this (this can be a lot more than an example, but only one sub-level):

  [[{1, "1"}, {D2, "2"}, {sub_data, [{d1, "3"}, {d2, "4"}}}], [{d1, "5"}, {d2, "6"}]] < / Code>  

I need to sort it ["5", "6"}]

[{"" 1 "," 2 " }>

Now I am doing this, which is not a great way:

  List: Map (Fun (Data) -> gt; [G (D1, Data), F: G (D2, Data)} + [["> & gt; ++ F: G (D1, SubData) }, {"& Gt; + + F: G (D2, SubData)}} SubData and LE    

Who I came with:

  changes (input) - & gt; List: Flaton (Lists: Map (Interesting - Item - - Change_Eystem (item, []) End, Input). Change_item (item, prefix) - & gt; {Kvs, subdata} = lists: (funny ({sub_data, _}) -> gt; false; (_) -> right end, item), res0 = list_to_tuple (lists: map (fun ({_, Value}} ([sub_data, SubItem}) -> change_item (subtitle, "" gt; end), subdata); (Resume, ]. (-) [-] Testing () -> Transforming Case ([[[1], "1"}, {d2, "2"}, {sub_data, [{d1, "3"}, {d2, "4" }}}, [[D1, "5" {"" 1 "," 2 "}, {"> 3 "," & gt; 4 "}, {" 5 "," 6 "}] - [& gt; Format: "format" (invalid, silk), end   Pre>  

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -