HackerRank 함수형 프로그래밍 수련 시작! my github jiyeonseo/HankerRank-FunctionalProgramming ...

HackerRank 함수형 프로그래밍 수련 시작! my github jiyeonseo/HankerRank-FunctionalProgramming ...

factorial :: Int -> Int factorial n = product [1..n] factorial maps any integer n to the product of the integers between 1 and n ex) factorial 4 = product [1..4] = product [1,2,3,4] = 1 ...

Conditional Expressions abs :: Int -> Int abs n = if n >= 0 then n else -n signum :: Int -> Int signum n = if n < 0 then -1 else if n == 0 then 0 else 1 ...

Set Comprehensions the comprehension notation can be used to construct new sets from old sets x <- [1..5] : generator Comprehensions can have multiple generators , separated bu commas e ...

Type Error > 1+ False Error Type in Haskell (expression)e :: (type)t :type in GHCi > not False True calculates the type of an expression > :type not False ...