С
Size: a a a
С
͏
͏
С
͏
С
͏
͏
͏
͏
*list-replication> :total f
Main.f is possibly not total due to:
Main.fa, which is possibly not total due to recursive path:
Main.fa, Main.fa
IR
A
[
͏
data Point = Point { x :: Int, y :: Int } deriving (Eq, Ord, Show)
distance :: Point -> Point -> Int
distance (Point x1 y1) (Point x2 y2) = abs (x1 - x2) + abs (y1 - y2)
-- perimeter :: [Point] ->
perimeter :: [Point] -> Int
perimeter points = sum $ map (distance) (zip points (tail points))͏
• Couldn't match expected type ‘Int’
with actual type ‘Point -> Int’
• In the expression:
sum $ map (distance) (zip points (tail points))
In an equation for ‘perimeter’:
perimeter points = sum $ map (distance) (zip points (tail points))
С
͏
JS
Point с результатом Point -> IntJS
IR