module Homework2 where deleteInt Int Int Int deleteInt deleteInt arg h

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Homework2 where
deleteInt :: Int -> [Int] -> [Int]
deleteInt _ [] = []
deleteInt arg (head:tail) | head == arg = deleteInt arg tail
| otherwise = head : (deleteInt arg tail)
findIndicesInt :: Int -> [Int] -> [Int]
findIndicesInt _ [] = []
findIndicesInt arg (head:tail) = findIndices' arg (head:tail) 0
where findIndices' _ [] _ = []
findIndices' arg (head:tail) ind | arg == head = ind : (findIndices' arg tail (ind+1))
| otherwise = findIndices' arg tail (ind+1)
tribo :: Int -> Int
tribo 0 = 1
tribo 1 = 1
tribo 2 = 1
tribo 3 = 3
tribo n = tribo (n-3) + tribo (n-2) + tribo (n-1)