2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-25 22:38:04 +02:00

GeoTopo images for easier compiling; Lazy evalution; Logik

This commit is contained in:
Martin Thoma 2014-03-01 20:04:19 +01:00
parent 1eb807d278
commit 1938222321
11 changed files with 215 additions and 5 deletions

View file

@ -0,0 +1,12 @@
summer :: [Int] -> Int
summer = foldr (-) 0
summel :: [Int] -> Int
summel = foldl (-) 0
main :: IO ()
main = do
print (summer [1,2,3])
-- 0-(1-(2-3)) = 0-(1-(-1)) = 2
print (summel [1,2,3])
-- ((0-1)-2)-3 = -6

View file

@ -0,0 +1,6 @@
g a b c
| c > 0 = b
| otherwise = a
main = do
print (g (1/0) 2 3)