)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"f5275fa91dc01ec94c920771b50c8cc2fd1e91ec","unresolved":true,"context_lines":[{"line_number":19,"context_line":"some predicate."},{"line_number":20,"context_line":"With `match`, we can then use that information to convert the"},{"line_number":21,"context_line":"discriminated values again."},{"line_number":22,"context_line":"With `hylo`, we can combine both the “constructive” discriminator step"},{"line_number":23,"context_line":"with the “destructive” match step to recursively walk over a nix data"},{"line_number":24,"context_line":"structure (based on a description of how to recurse, e.g. through attrset"},{"line_number":25,"context_line":"values or list values), and then apply a transformation in one go."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"68f06ba7_30856940","line":22,"updated":"2021-01-23 18:30:58.000000000","message":"hylo is missing from this change.","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"16ddd1b4a24941a2199bb4cc56ffc0df3c04c770","unresolved":false,"context_lines":[{"line_number":19,"context_line":"some predicate."},{"line_number":20,"context_line":"With `match`, we can then use that information to convert the"},{"line_number":21,"context_line":"discriminated values again."},{"line_number":22,"context_line":"With `hylo`, we can combine both the “constructive” discriminator step"},{"line_number":23,"context_line":"with the “destructive” match step to recursively walk over a nix data"},{"line_number":24,"context_line":"structure (based on a description of how to recurse, e.g. through attrset"},{"line_number":25,"context_line":"values or list values), and then apply a transformation in one go."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ee4c8458_e21d38ac","line":22,"in_reply_to":"68f06ba7_30856940","updated":"2021-01-27 13:42:19.000000000","message":"hylo is in the next change","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"}],"nix/tag/default.nix":[{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"87f9adc7f18028c0e543d80d4b0487c1825aceed","unresolved":true,"context_lines":[{"line_number":4,"context_line":"  # if so sets `isTag` to `true` and sets the name and value."},{"line_number":5,"context_line":"  # If not, sets `isTag` to `false` and sets `errmsg`."},{"line_number":6,"context_line":"  isTag \u003d tag:"},{"line_number":7,"context_line":"    let cases \u003d builtins.attrNames tag;"},{"line_number":8,"context_line":"        len \u003d builtins.length cases;"},{"line_number":9,"context_line":"    in"},{"line_number":10,"context_line":"    if builtins.length cases \u003d\u003d 1"}],"source_content_type":"text/x-nix","patch_set":1,"id":"6081c55a_61e3146f","line":7,"updated":"2021-01-27 14:26:52.000000000","message":"I feel like `isTag` should not throw an error if the supplied value is not a set at least by virtue of being named like the builtin type discriminators.\n\nA check for set would be nice imo.","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"d8d748dd9f8fb79633a1bb1ea554f5f6d66f02bb","unresolved":false,"context_lines":[{"line_number":4,"context_line":"  # if so sets `isTag` to `true` and sets the name and value."},{"line_number":5,"context_line":"  # If not, sets `isTag` to `false` and sets `errmsg`."},{"line_number":6,"context_line":"  isTag \u003d tag:"},{"line_number":7,"context_line":"    let cases \u003d builtins.attrNames tag;"},{"line_number":8,"context_line":"        len \u003d builtins.length cases;"},{"line_number":9,"context_line":"    in"},{"line_number":10,"context_line":"    if builtins.length cases \u003d\u003d 1"}],"source_content_type":"text/x-nix","patch_set":1,"id":"5a6565e6_751b691c","line":7,"in_reply_to":"6081c55a_61e3146f","updated":"2021-01-30 15:17:09.000000000","message":"Isn’t that a slippery slope though, because now you can’t distinguish whether you have a random scalar or list, or just an attrset that has more or less elements;\n\nMaybe the best is to rename the function to `verifyTag` or something.\n\nUpdate: I renamed it to `verifyTag`.","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"87f9adc7f18028c0e543d80d4b0487c1825aceed","unresolved":true,"context_lines":[{"line_number":39,"context_line":"  #"},{"line_number":40,"context_line":"  # `defTag` is the tag that is assigned if there is no match."},{"line_number":41,"context_line":"  #"},{"line_number":42,"context_line":"  # Examples:"},{"line_number":43,"context_line":"  #   discrDef \"smol\" {"},{"line_number":44,"context_line":"  #     biggerFive \u003d i: i \u003e 5;"},{"line_number":45,"context_line":"  #     negative \u003d i: i \u003c 0;"}],"source_content_type":"text/x-nix","patch_set":1,"id":"0c09bf3a_a8711c02","line":42,"updated":"2021-01-27 14:26:52.000000000","message":"The documentation here is inaccurate: `discrDef` expects a list of discrimantors, not a set.\n\nUsing a set would be nice for consistency, but isn\u0027t desireable probably because it\u0027d make predicate application order unpredictable.","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"d8d748dd9f8fb79633a1bb1ea554f5f6d66f02bb","unresolved":false,"context_lines":[{"line_number":39,"context_line":"  #"},{"line_number":40,"context_line":"  # `defTag` is the tag that is assigned if there is no match."},{"line_number":41,"context_line":"  #"},{"line_number":42,"context_line":"  # Examples:"},{"line_number":43,"context_line":"  #   discrDef \"smol\" {"},{"line_number":44,"context_line":"  #     biggerFive \u003d i: i \u003e 5;"},{"line_number":45,"context_line":"  #     negative \u003d i: i \u003c 0;"}],"source_content_type":"text/x-nix","patch_set":1,"id":"61c86494_2623937c","line":42,"in_reply_to":"0c09bf3a_a8711c02","updated":"2021-01-30 15:17:09.000000000","message":"Done","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"87f9adc7f18028c0e543d80d4b0487c1825aceed","unresolved":true,"context_lines":[{"line_number":93,"context_line":"    let cases \u003d builtins.attrNames sum;"},{"line_number":94,"context_line":"    in assert"},{"line_number":95,"context_line":"      let len \u003d builtins.length cases; in"},{"line_number":96,"context_line":"        lib.assertMsg (builtins.length cases \u003d\u003d 1)"},{"line_number":97,"context_line":"          ( \"match: an instance of a sum is an attrset \""},{"line_number":98,"context_line":"          + \"with exactly one element, yours had ${toString len}\""},{"line_number":99,"context_line":"          + \", namely: ${lib.generators.toPretty {} cases}\" );"}],"source_content_type":"text/x-nix","patch_set":1,"id":"f62496f3_7ccc4b3f","line":96,"updated":"2021-01-27 14:26:52.000000000","message":"You could reuse `isTag` here, I think?","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"25a74ea8a4a53eaf633c1933cef6bd6bfb6dbaad","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    let cases \u003d builtins.attrNames sum;"},{"line_number":94,"context_line":"    in assert"},{"line_number":95,"context_line":"      let len \u003d builtins.length cases; in"},{"line_number":96,"context_line":"        lib.assertMsg (builtins.length cases \u003d\u003d 1)"},{"line_number":97,"context_line":"          ( \"match: an instance of a sum is an attrset \""},{"line_number":98,"context_line":"          + \"with exactly one element, yours had ${toString len}\""},{"line_number":99,"context_line":"          + \", namely: ${lib.generators.toPretty {} cases}\" );"}],"source_content_type":"text/x-nix","patch_set":1,"id":"70746f0b_d699bae0","line":96,"in_reply_to":"20db89fc_402d344b","updated":"2021-01-30 15:25:36.000000000","message":"Isn\u0027t that irrelevant if you only evaluate `(isTag x).isTag` because of laziness?","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"63e2a7510d6e53067ab4a373cb105eff6ac50a2e","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    let cases \u003d builtins.attrNames sum;"},{"line_number":94,"context_line":"    in assert"},{"line_number":95,"context_line":"      let len \u003d builtins.length cases; in"},{"line_number":96,"context_line":"        lib.assertMsg (builtins.length cases \u003d\u003d 1)"},{"line_number":97,"context_line":"          ( \"match: an instance of a sum is an attrset \""},{"line_number":98,"context_line":"          + \"with exactly one element, yours had ${toString len}\""},{"line_number":99,"context_line":"          + \", namely: ${lib.generators.toPretty {} cases}\" );"}],"source_content_type":"text/x-nix","patch_set":1,"id":"2777434c_42fd2f92","line":96,"in_reply_to":"70746f0b_d699bae0","updated":"2021-01-30 15:31:00.000000000","message":"No, nix doesn’t cache subexpressions it evaluates, even if they are the same.\n\n```\n{ a \u003d length l;\n  b \u003d length l; }\n```\n\nwill run `length l` twice, you need to float it into a `let` if you don’t want to incur the cost.\n\nI believe GHC does some optimizations like that within the scope of a function or depending on whether something is inlined in a core pass.","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"d8d748dd9f8fb79633a1bb1ea554f5f6d66f02bb","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    let cases \u003d builtins.attrNames sum;"},{"line_number":94,"context_line":"    in assert"},{"line_number":95,"context_line":"      let len \u003d builtins.length cases; in"},{"line_number":96,"context_line":"        lib.assertMsg (builtins.length cases \u003d\u003d 1)"},{"line_number":97,"context_line":"          ( \"match: an instance of a sum is an attrset \""},{"line_number":98,"context_line":"          + \"with exactly one element, yours had ${toString len}\""},{"line_number":99,"context_line":"          + \", namely: ${lib.generators.toPretty {} cases}\" );"}],"source_content_type":"text/x-nix","patch_set":1,"id":"20db89fc_402d344b","line":96,"in_reply_to":"f62496f3_7ccc4b3f","updated":"2021-01-30 15:17:09.000000000","message":"\u003e You could reuse `isTag` here, I think?\n\nI tried that, but then `isTag` does some extra work like the `builtins.head cases`, so I opted for being more standalone \u0026 slightly quicker.","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"a2289c50755d5e996401296729529a01bf325915","unresolved":true,"context_lines":[{"line_number":93,"context_line":"    let cases \u003d builtins.attrNames sum;"},{"line_number":94,"context_line":"    in assert"},{"line_number":95,"context_line":"      let len \u003d builtins.length cases; in"},{"line_number":96,"context_line":"        lib.assertMsg (builtins.length cases \u003d\u003d 1)"},{"line_number":97,"context_line":"          ( \"match: an instance of a sum is an attrset \""},{"line_number":98,"context_line":"          + \"with exactly one element, yours had ${toString len}\""},{"line_number":99,"context_line":"          + \", namely: ${lib.generators.toPretty {} cases}\" );"}],"source_content_type":"text/x-nix","patch_set":3,"id":"55d2f98b_fd26fc7a","line":96,"updated":"2021-01-30 15:33:39.000000000","message":"You can reuse `len` here.","commit_id":"2f6ac057ba251accc3bffd8cc6c4df3b44fb0976"},{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"fa1c242119a46cd67acda7a9f9d7d9816b1bfff7","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    let cases \u003d builtins.attrNames sum;"},{"line_number":94,"context_line":"    in assert"},{"line_number":95,"context_line":"      let len \u003d builtins.length cases; in"},{"line_number":96,"context_line":"        lib.assertMsg (builtins.length cases \u003d\u003d 1)"},{"line_number":97,"context_line":"          ( \"match: an instance of a sum is an attrset \""},{"line_number":98,"context_line":"          + \"with exactly one element, yours had ${toString len}\""},{"line_number":99,"context_line":"          + \", namely: ${lib.generators.toPretty {} cases}\" );"}],"source_content_type":"text/x-nix","patch_set":3,"id":"284f49f8_af6b3f46","line":96,"in_reply_to":"55d2f98b_fd26fc7a","updated":"2021-01-30 15:38:25.000000000","message":"Done","commit_id":"2f6ac057ba251accc3bffd8cc6c4df3b44fb0976"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"0330775f208ff6f7294b77d05dfd6f5698c2a06e","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    let cases \u003d builtins.attrNames sum;"},{"line_number":94,"context_line":"    in assert"},{"line_number":95,"context_line":"      let len \u003d builtins.length cases; in"},{"line_number":96,"context_line":"        lib.assertMsg (builtins.length cases \u003d\u003d 1)"},{"line_number":97,"context_line":"          ( \"match: an instance of a sum is an attrset \""},{"line_number":98,"context_line":"          + \"with exactly one element, yours had ${toString len}\""},{"line_number":99,"context_line":"          + \", namely: ${lib.generators.toPretty {} cases}\" );"}],"source_content_type":"text/x-nix","patch_set":3,"id":"496befad_a60c2ff8","line":96,"in_reply_to":"55d2f98b_fd26fc7a","updated":"2021-01-30 15:38:46.000000000","message":"lol, pretty sure I floated it out for that purpose but then didn’t replace both.","commit_id":"2f6ac057ba251accc3bffd8cc6c4df3b44fb0976"}],"nix/tag/tests.nix":[{"author":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"change_message_id":"87f9adc7f18028c0e543d80d4b0487c1825aceed","unresolved":true,"context_lines":[{"line_number":55,"context_line":"  runTestsuite \"tag\" ["},{"line_number":56,"context_line":"    isTag-test"},{"line_number":57,"context_line":"    discr-test"},{"line_number":58,"context_line":"  ]"}],"source_content_type":"text/x-nix","patch_set":1,"id":"1dca7248_0524c4b5","line":58,"updated":"2021-01-27 14:26:52.000000000","message":"Tests for `match` would be nice.","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"},{"author":{"_account_id":1000013,"name":"Profpatsch","email":"mail@profpatsch.de","username":"Profpatsch"},"change_message_id":"d8d748dd9f8fb79633a1bb1ea554f5f6d66f02bb","unresolved":false,"context_lines":[{"line_number":55,"context_line":"  runTestsuite \"tag\" ["},{"line_number":56,"context_line":"    isTag-test"},{"line_number":57,"context_line":"    discr-test"},{"line_number":58,"context_line":"  ]"}],"source_content_type":"text/x-nix","patch_set":1,"id":"f9ac92b6_e2ff0a8e","line":58,"in_reply_to":"1dca7248_0524c4b5","updated":"2021-01-30 15:17:09.000000000","message":"Done","commit_id":"c770604e09978280031a163cefc6c8a9d964a3f6"}]}
