summary refs log tree commit diff
path: root/lib/head.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/head.fnl')
-rw-r--r--lib/head.fnl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/head.fnl b/lib/head.fnl
new file mode 100644
index 0000000..ddee698
--- /dev/null
+++ b/lib/head.fnl
@@ -0,0 +1,6 @@
+; return the first item in a table
+(fn head [t] (if (> (length t) 0)
+               (?. t 1)
+               []))
+
+{: head}