Files
  • main.hs
main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
goto :: Int -> Int
goto x = x + 2

ispisin :: Int -> [Int]
ispisin n = [1..n]

faktori :: Int -> [Int]
faktori n = [x | x <- [1..n] , n `mod` x ==0]

prost :: Int -> Bool
prost n = (faktori n == [1,n])

listap :: Int -> [Int]
listap n = [x | x <- [1..n] , prost x ]

suman :: Int -> Int
suman 0 = 0
suman n = 1 + (suman n-1)
GHCi, version 8.6.3