Skip to content

Instantly share code, notes, and snippets.

@mykhas
Created April 24, 2017 11:10
Show Gist options
  • Save mykhas/9f2de57651d45f50355436aa3a9b8dfe to your computer and use it in GitHub Desktop.
Save mykhas/9f2de57651d45f50355436aa3a9b8dfe to your computer and use it in GitHub Desktop.
sum' :: Num a => [a] -> a
sum' xs = case xs of
[] -> 0
(x:xs) -> x + sum' xs
initials :: String -> String -> String -- чому не працює String a => a -> a -> a
initials fn ln = [f] ++ " " ++ [l]
where (f:_) = fn
(l:_) = ln
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment