Applicative instance for List.
commit1c096fc2abcea46315f26673d6019046f7e84294
authorstartling <tdixon51793@gmail.com>
dateThu 15 Nov 2012, 13:44 (14 years ago)
parent04642a8
lib/Prelude.idr+5
@@ -128,6 +128,11 @@ instance Applicative (Either e) where
128128 (Right f) <$> (Right r) = Right (f r)
129129 (Right _) <$> (Left l) = Left l
130130
131+instance Applicative List where
132+ pure x = [x]
133+
134+ fs <$> vs = concatMap (\f => map f vs) fs
135+
131136---- some mathematical operations
132137
133138%include "math.h"