factorial !n =
go 1 n
where
+ go :: Int -> Int -> Int
go !acc !i
| i <= 1 = acc
| otherwise = go (acc * i) (i - 1)
assertEqual "flatten actually works" expected_list actual_list
where
target = [[[1::Int]], [[2, 3]]]
- expected_list = [1, 2, 3]
+ expected_list = [1, 2, 3] :: [Int]
actual_list = flatten target