What do you want to save?
Add Code snippet
New code examples in category Haskell
-
IllusiveBrian 2022-03-03 08:10:01
list length haskell
-- input length [1,2,3] -- output 3 Add solution -
Phoenix Logan 2022-01-29 08:16:12
haskell max function
-- fold the list: maximum' :: Ord a => [a] -> a maximum' = foldr1 (\x y ->if x >= y then x else y) --For the recursive version (no double checking): maximum'' :: Ord a => [a] -> a maximum'' [x] = x maximum'' (x:x':xs) = maximum'... Add solution -
Awgiedawgie 2022-01-27 18:51:21
haskell merge lists
"hello " ++ "world" Add solution -
Phoenix Logan 2022-01-22 12:26:49
list comprehension haskell
list = [1, 2, 3, 4] evens = [x | x <- list, even x] -- [2, 4] mul3List = [3*x | x <- list] -- [3, 6, 9, 12] odds = [3*x | x <- mul3List, odd (3*x)] -- [3, 9] allCombinations = [(y, x) | x <- list, y <- list] -- [(1, 1), (1, 2) ... Add solution
Best helpers
Ranking is empty