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