import Data.Listimport Data.Maybe main = print . maybe 0 (sum . takeWhile (>=0) . snd) . uncons . snd . break (<0) =<< readLn
[1,2,-3,4,5,6,-10,19993,23]
[1 of 1] Compiling Main ( prog.hs, prog.o ) prog.hs:4:56: Not in scope: `uncons' Perhaps you meant `union' (imported from Data.List)
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!