From e9f7ad6373bb835cf35c67316f7d6296ae9067ea Mon Sep 17 00:00:00 2001 From: Jaro Date: Wed, 8 Mar 2023 00:13:06 +0100 Subject: [PATCH] Hide Rect union from public interface. The function behaves in a specific way that should not be relied on by other modules. --- lib/Data/Text/ParagraphLayout/Rect.hs | 1 - src/Data/Text/ParagraphLayout/Internal/Rect.hs | 3 --- test/Data/Text/ParagraphLayout/RectSpec.hs | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/Data/Text/ParagraphLayout/Rect.hs b/lib/Data/Text/ParagraphLayout/Rect.hs index 2ba4e71..88b560e 100644 --- a/lib/Data/Text/ParagraphLayout/Rect.hs +++ b/lib/Data/Text/ParagraphLayout/Rect.hs @@ -3,7 +3,6 @@ module Data.Text.ParagraphLayout.Rect (Rect(Rect, x_origin, y_origin, x_size, y_size) ,height - ,union ,width ,x_max ,x_min diff --git a/src/Data/Text/ParagraphLayout/Internal/Rect.hs b/src/Data/Text/ParagraphLayout/Internal/Rect.hs index 12f9c10..60ab347 100644 --- a/src/Data/Text/ParagraphLayout/Internal/Rect.hs +++ b/src/Data/Text/ParagraphLayout/Internal/Rect.hs @@ -63,6 +63,3 @@ union a b = Rect x_low y_high dx (-dy) where y_high = y_max a `max` y_max b dx = x_high - x_low dy = y_high - y_low - -instance (Num a, Ord a) => Semigroup (Rect a) where - (<>) = union diff --git a/test/Data/Text/ParagraphLayout/RectSpec.hs b/test/Data/Text/ParagraphLayout/RectSpec.hs index 36185ac..a5939d5 100644 --- a/test/Data/Text/ParagraphLayout/RectSpec.hs +++ b/test/Data/Text/ParagraphLayout/RectSpec.hs @@ -3,7 +3,7 @@ module Data.Text.ParagraphLayout.RectSpec (spec) where import Data.Int (Int32) import Test.Hspec -import Data.Text.ParagraphLayout.Rect +import Data.Text.ParagraphLayout.Internal.Rect positiveRect :: Rect Int32 positiveRect = Rect 50 (-70) 10 10 -- 2.30.2