summary refs log tree commit diff
path: root/lib/kvflip.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kvflip.fnl')
-rw-r--r--lib/kvflip.fnl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/kvflip.fnl b/lib/kvflip.fnl
new file mode 100644
index 0000000..25fc222
--- /dev/null
+++ b/lib/kvflip.fnl
@@ -0,0 +1,6 @@
+(fn kvflip [t]
+  "takes a table of {key value} and returns a table of {value key}"
+  (collect [k v (pairs t)] (values v k)))
+
+{: kvflip}
+