shithub: MicroHs

Download patch

ref: 2216858c6af04eeeebd0987bc80bcef4b03c9e01
parent: e8f8e6e12200daae67096def5099eef7d13e0b5a
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Sat Sep 23 16:16:19 EDT 2023

Add init.

--- a/lib/Data/List.hs
+++ b/lib/Data/List.hs
@@ -305,3 +305,8 @@
 last [] = error "last: []"
 last [x] = x
 last (_:xs) = last xs
+
+init :: forall a . [a] -> [a]
+init [] = error "init: []"
+init [_] = []
+init (x:xs) = x : init xs
--