From 436da9f2bc85459cc6517ec21ebcf6171520e019 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Grave Date: Sun, 24 Feb 2019 15:20:03 +0000 Subject: Make function call clearer --- src/Main.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index 89ad27c..2f02cfd 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -121,7 +121,7 @@ add _ _ = error "Mono not supported" totalRadiance :: [[PFMColour]] -> PFMColour totalRadiance c = f $ f <$> c where f = foldl' add (PFMColour 0 0 0) -recSplitGeneral +makeRecSplit :: (Eq a1, Num a1) => (PFMColour -> [[Double]] -> [[a2]] -> [[a3]]) -> (PFMColour -> Cut -> [[a3]] -> [[a3]]) @@ -129,19 +129,19 @@ recSplitGeneral -> [[Double]] -> [[a2]] -> [[a3]] -recSplitGeneral dFun _ 0 d c = dFun (PFMColour 0 0 1) d c -recSplitGeneral dFun dCut n d c = dCut (PFMColour 1 1 1) cut a +makeRecSplit dFun _ 0 d c = dFun (PFMColour 0 0 1) d c +makeRecSplit dFun dCut n d c = dCut (PFMColour 1 1 1) cut a where cut = findSplitLine d a = combine cut . apply nrec $ split cut c (d1, d2) = split cut d - nrec = bbimap (recSplitGeneral dFun dCut (n - 1)) (d1, d2) + nrec = bbimap (makeRecSplit dFun dCut (n - 1)) (d1, d2) apply (f, g) (a', c') = (f a', g c') recSplitRadiance, recSplit :: Int -> [[Double]] -> [[PFMColour]] -> [[PFMColour]] -recSplit = recSplitGeneral drawCentroid drawCut -recSplitRadiance = recSplitGeneral drawCentroidBlack (\_ _ -> id) +recSplit = makeRecSplit drawCentroid drawCut +recSplitRadiance = makeRecSplit drawCentroidBlack (\_ _ -> id) generateCuts :: Show a -- cgit