Skip to content

Instantly share code, notes, and snippets.

@hamzamuric
Created April 30, 2019 18:42
Show Gist options
  • Save hamzamuric/e0a64e59e015ce31f452e707df2b7a56 to your computer and use it in GitHub Desktop.
Save hamzamuric/e0a64e59e015ce31f452e707df2b7a56 to your computer and use it in GitHub Desktop.
Prvo okupljanje kluba programera
// Zadatak 1
reverse' :: [a] -> [a]
reverse' [] = []
reverse' (x:xs) = reverse' xs ++ [x]
// Zadatak 2
unique' :: (Eq a) => [a] -> [a]
unique' [] = []
unique' (x:xs) = x : unique' (filter ((/=) x) xs)
// Zadatak 3
allunique' :: (Eq a) => [a] -> Bool
allunique' [] = True
allunique' (x:xs) = notElem x xs && allunique' xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment