X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FMisc.hs;h=56d33eb43c3969ce0c9c40b5efb81582d0b888b1;hb=65c78573af4a1049a848a3df8a968a4eb1b1acc1;hp=e6cd07ea987cbfb38a621b2b10c6afe6f3d329e6;hpb=a499efdb0e215ac424fe7c38a52430daebefc22b;p=spline3.git diff --git a/src/Misc.hs b/src/Misc.hs index e6cd07e..56d33eb 100644 --- a/src/Misc.hs +++ b/src/Misc.hs @@ -35,6 +35,7 @@ factorial :: Int -> Int factorial !n = go 1 n where + go :: Int -> Int -> Int go !acc !i | i <= 1 = acc | otherwise = go (acc * i) (i - 1) @@ -110,7 +111,7 @@ test_flatten1 = 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