Sha256: 8161fd4a730c2dbd203323b02dab9439132a846726b08176333a6625729a42d0
Contents?: true
Size: 661 Bytes
Versions: 310
Compression:
Stored size: 661 Bytes
Contents
-module(example). -export([transform/1, test_version/0]). transform(OldValue) -> orddict:to_list( orddict:from_list( lists:flatten( invert(OldValue) ) ) ). test_version() -> 1. invert(Pairs) -> lists:foldl( fun({Key, Values}, A) -> lists:foldl( fun(Value, Acc) -> orddict:update( string:to_lower(Value), fun (Old) -> lists:flatten([Old] ++ [Key]) end, Key, Acc ) end, A, Values ) end, orddict:new(), Pairs ).
Version data entries
310 entries across 310 versions & 1 rubygems