data MyList a
= Nil
| Cons a
(MyList a
) deriving (Eq,Ord,Show,Read)
range n m |n == m = Cons m Nil
range n m = Cons n (range (n + 1) m)
myfoldl _ v Nil = v
myfoldl f v (Cons x xs) = myfoldl f (f v x) xs
myreverse = myfoldl (\ys x -> Cons x ys) Nil
myhead (Cons x _) = x
main
= print (myhead
(myreverse
(range
1 1000000)))
ZGF0YSBNeUxpc3QgYSA9IE5pbCB8IENvbnMgYSAoTXlMaXN0IGEpIGRlcml2aW5nIChFcSxPcmQsU2hvdyxSZWFkKQogCnJhbmdlIG4gbSB8biA9PSBtID0gQ29ucyBtIE5pbApyYW5nZSBuIG0gPSBDb25zIG4gKHJhbmdlIChuICsgMSkgbSkKIApteWZvbGRsIF8gdiBOaWwgPSB2Cm15Zm9sZGwgZiB2IChDb25zIHggeHMpID0gbXlmb2xkbCBmIChmIHYgeCkgeHMKIApteXJldmVyc2UgPSBteWZvbGRsIChceXMgeCAtPiBDb25zIHggeXMpIE5pbAogCm15aGVhZCAoQ29ucyB4IF8pID0geAogCm1haW4gPSBwcmludCAobXloZWFkIChteXJldmVyc2UgKHJhbmdlIDEgMTAwMDAwMCkpKQ==