{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module CodeWorld.Picture where
import CodeWorld.Color
import Control.DeepSeq
import Data.List
import Data.Text (Text)
import GHC.Generics (Generic)
import GHC.Stack
import Util.EmbedAsUrl
type Point = (Double, Double)
translatedPoint :: Double -> Double -> Point -> Point
translatedPoint :: Double -> Double -> Point -> Point
translatedPoint Double
tx Double
ty (Double
x, Double
y) = (Double
x forall a. Num a => a -> a -> a
+ Double
tx, Double
y forall a. Num a => a -> a -> a
+ Double
ty)
rotatedPoint :: Double -> Point -> Point
rotatedPoint :: Double -> Point -> Point
rotatedPoint = Double -> Point -> Point
rotatedVector
reflectedPoint :: Double -> Point -> Point
reflectedPoint :: Double -> Point -> Point
reflectedPoint Double
th (Double
x, Double
y) = (Double
x forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
cos Double
a forall a. Num a => a -> a -> a
+ Double
y forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
sin Double
a, Double
x forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
sin Double
a forall a. Num a => a -> a -> a
- Double
y forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
cos Double
a)
where
a :: Double
a = Double
2 forall a. Num a => a -> a -> a
* Double
th
scaledPoint :: Double -> Double -> Point -> Point
scaledPoint :: Double -> Double -> Point -> Point
scaledPoint Double
kx Double
ky (Double
x, Double
y) = (Double
kx forall a. Num a => a -> a -> a
* Double
x, Double
ky forall a. Num a => a -> a -> a
* Double
y)
dilatedPoint :: Double -> Point -> Point
dilatedPoint :: Double -> Point -> Point
dilatedPoint Double
k (Double
x, Double
y) = (Double
k forall a. Num a => a -> a -> a
* Double
x, Double
k forall a. Num a => a -> a -> a
* Double
y)
type Vector = (Double, Double)
vectorLength :: Vector -> Double
vectorLength :: Point -> Double
vectorLength (Double
x, Double
y) = forall a. Floating a => a -> a
sqrt (Double
x forall a. Num a => a -> a -> a
* Double
x forall a. Num a => a -> a -> a
+ Double
y forall a. Num a => a -> a -> a
* Double
y)
vectorDirection :: Vector -> Double
vectorDirection :: Point -> Double
vectorDirection (Double
x, Double
y) = forall a. RealFloat a => a -> a -> a
atan2 Double
y Double
x
vectorSum :: Vector -> Vector -> Vector
vectorSum :: Point -> Point -> Point
vectorSum (Double
x1, Double
y1) (Double
x2, Double
y2) = (Double
x1 forall a. Num a => a -> a -> a
+ Double
x2, Double
y1 forall a. Num a => a -> a -> a
+ Double
y2)
vectorDifference :: Vector -> Vector -> Vector
vectorDifference :: Point -> Point -> Point
vectorDifference (Double
x1, Double
y1) (Double
x2, Double
y2) = (Double
x1 forall a. Num a => a -> a -> a
- Double
x2, Double
y1 forall a. Num a => a -> a -> a
- Double
y2)
scaledVector :: Double -> Vector -> Vector
scaledVector :: Double -> Point -> Point
scaledVector Double
k (Double
x, Double
y) = (Double
k forall a. Num a => a -> a -> a
* Double
x, Double
k forall a. Num a => a -> a -> a
* Double
y)
rotatedVector :: Double -> Vector -> Vector
rotatedVector :: Double -> Point -> Point
rotatedVector Double
angle (Double
x, Double
y) =
(Double
x forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
cos Double
angle forall a. Num a => a -> a -> a
- Double
y forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
sin Double
angle, Double
x forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
sin Double
angle forall a. Num a => a -> a -> a
+ Double
y forall a. Num a => a -> a -> a
* forall a. Floating a => a -> a
cos Double
angle)
dotProduct :: Vector -> Vector -> Double
dotProduct :: Point -> Point -> Double
dotProduct (Double
x1, Double
y1) (Double
x2, Double
y2) = Double
x1 forall a. Num a => a -> a -> a
* Double
x2 forall a. Num a => a -> a -> a
+ Double
y1 forall a. Num a => a -> a -> a
* Double
y2
data Picture
= SolidPolygon (Maybe SrcLoc) [Point]
| SolidClosedCurve (Maybe SrcLoc) [Point]
| Polygon (Maybe SrcLoc) [Point]
| ThickPolygon (Maybe SrcLoc) [Point] !Double
| Rectangle (Maybe SrcLoc) !Double !Double
| SolidRectangle (Maybe SrcLoc) !Double !Double
| ThickRectangle (Maybe SrcLoc) !Double !Double !Double
| ClosedCurve (Maybe SrcLoc) [Point]
| ThickClosedCurve (Maybe SrcLoc) [Point] !Double
| Polyline (Maybe SrcLoc) [Point]
| ThickPolyline (Maybe SrcLoc) [Point] !Double
| Curve (Maybe SrcLoc) [Point]
| ThickCurve (Maybe SrcLoc) [Point] !Double
| Circle (Maybe SrcLoc) !Double
| SolidCircle (Maybe SrcLoc) !Double
| ThickCircle (Maybe SrcLoc) !Double !Double
| Sector (Maybe SrcLoc) !Double !Double !Double
| Arc (Maybe SrcLoc) !Double !Double !Double
| ThickArc (Maybe SrcLoc) !Double !Double !Double !Double
| StyledLettering (Maybe SrcLoc) !TextStyle !Font !Text
| Lettering (Maybe SrcLoc) !Text
| Color (Maybe SrcLoc) !Color !Picture
| Translate (Maybe SrcLoc) !Double !Double !Picture
| Scale (Maybe SrcLoc) !Double !Double !Picture
| Dilate (Maybe SrcLoc) !Double !Picture
| Rotate (Maybe SrcLoc) !Double !Picture
| Reflect (Maybe SrcLoc) !Double !Picture
| Clip (Maybe SrcLoc) !Double !Double !Picture
| CoordinatePlane (Maybe SrcLoc)
| Sketch (Maybe SrcLoc) !Text !Text !Double !Double
| Pictures (Maybe SrcLoc) [Picture]
| PictureAnd (Maybe SrcLoc) [Picture]
| Blank (Maybe SrcLoc)
deriving (forall x. Rep Picture x -> Picture
forall x. Picture -> Rep Picture x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Picture x -> Picture
$cfrom :: forall x. Picture -> Rep Picture x
Generic)
instance NFData Picture
data TextStyle
=
Plain
|
Bold
|
Italic
deriving (forall x. Rep TextStyle x -> TextStyle
forall x. TextStyle -> Rep TextStyle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextStyle x -> TextStyle
$cfrom :: forall x. TextStyle -> Rep TextStyle x
Generic, Int -> TextStyle -> ShowS
[TextStyle] -> ShowS
TextStyle -> [Char]
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
showList :: [TextStyle] -> ShowS
$cshowList :: [TextStyle] -> ShowS
show :: TextStyle -> [Char]
$cshow :: TextStyle -> [Char]
showsPrec :: Int -> TextStyle -> ShowS
$cshowsPrec :: Int -> TextStyle -> ShowS
Show)
instance NFData TextStyle
data Font
= SansSerif
| Serif
| Monospace
| Handwriting
| Fancy
| NamedFont !Text
deriving (forall x. Rep Font x -> Font
forall x. Font -> Rep Font x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Font x -> Font
$cfrom :: forall x. Font -> Rep Font x
Generic, Int -> Font -> ShowS
[Font] -> ShowS
Font -> [Char]
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
showList :: [Font] -> ShowS
$cshowList :: [Font] -> ShowS
show :: Font -> [Char]
$cshow :: Font -> [Char]
showsPrec :: Int -> Font -> ShowS
$cshowsPrec :: Int -> Font -> ShowS
Show)
instance NFData Font
blank :: HasCallStack => Picture
blank :: HasCallStack => Picture
blank = Maybe SrcLoc -> Picture
Blank (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
polyline :: HasCallStack => [Point] -> Picture
polyline :: HasCallStack => [Point] -> Picture
polyline [Point]
ps = Maybe SrcLoc -> [Point] -> Picture
Polyline (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps
thickPolyline :: HasCallStack => Double -> [Point] -> Picture
thickPolyline :: HasCallStack => Double -> [Point] -> Picture
thickPolyline Double
n [Point]
ps = Maybe SrcLoc -> [Point] -> Double -> Picture
ThickPolyline (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps Double
n
polygon :: HasCallStack => [Point] -> Picture
polygon :: HasCallStack => [Point] -> Picture
polygon [Point]
ps = Maybe SrcLoc -> [Point] -> Picture
Polygon (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps
thickPolygon :: HasCallStack => Double -> [Point] -> Picture
thickPolygon :: HasCallStack => Double -> [Point] -> Picture
thickPolygon Double
n [Point]
ps = Maybe SrcLoc -> [Point] -> Double -> Picture
ThickPolygon (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps Double
n
solidPolygon :: HasCallStack => [Point] -> Picture
solidPolygon :: HasCallStack => [Point] -> Picture
solidPolygon [Point]
ps = Maybe SrcLoc -> [Point] -> Picture
SolidPolygon (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps
curve :: HasCallStack => [Point] -> Picture
curve :: HasCallStack => [Point] -> Picture
curve [Point]
ps = Maybe SrcLoc -> [Point] -> Picture
Curve (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps
thickCurve :: HasCallStack => Double -> [Point] -> Picture
thickCurve :: HasCallStack => Double -> [Point] -> Picture
thickCurve Double
n [Point]
ps = Maybe SrcLoc -> [Point] -> Double -> Picture
ThickCurve (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps Double
n
closedCurve :: HasCallStack => [Point] -> Picture
closedCurve :: HasCallStack => [Point] -> Picture
closedCurve [Point]
ps = Maybe SrcLoc -> [Point] -> Picture
ClosedCurve (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps
thickClosedCurve :: HasCallStack => Double -> [Point] -> Picture
thickClosedCurve :: HasCallStack => Double -> [Point] -> Picture
thickClosedCurve Double
n [Point]
ps = Maybe SrcLoc -> [Point] -> Double -> Picture
ThickClosedCurve (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps Double
n
solidClosedCurve :: HasCallStack => [Point] -> Picture
solidClosedCurve :: HasCallStack => [Point] -> Picture
solidClosedCurve [Point]
ps = Maybe SrcLoc -> [Point] -> Picture
SolidClosedCurve (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Point]
ps
rectangleVertices :: Double -> Double -> [Point]
rectangleVertices :: Double -> Double -> [Point]
rectangleVertices Double
w Double
h = [(Double
w forall a. Fractional a => a -> a -> a
/ Double
2, Double
h forall a. Fractional a => a -> a -> a
/ Double
2), (Double
w forall a. Fractional a => a -> a -> a
/ Double
2, - Double
h forall a. Fractional a => a -> a -> a
/ Double
2), (- Double
w forall a. Fractional a => a -> a -> a
/ Double
2, - Double
h forall a. Fractional a => a -> a -> a
/ Double
2), (- Double
w forall a. Fractional a => a -> a -> a
/ Double
2, Double
h forall a. Fractional a => a -> a -> a
/ Double
2)]
rectangle :: HasCallStack => Double -> Double -> Picture
rectangle :: HasCallStack => Double -> Double -> Picture
rectangle Double
w Double
h = Maybe SrcLoc -> Double -> Double -> Picture
Rectangle (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) Double
w Double
h
solidRectangle :: HasCallStack => Double -> Double -> Picture
solidRectangle :: HasCallStack => Double -> Double -> Picture
solidRectangle Double
w Double
h = Maybe SrcLoc -> Double -> Double -> Picture
SolidRectangle (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) Double
w Double
h
thickRectangle :: HasCallStack => Double -> Double -> Double -> Picture
thickRectangle :: HasCallStack => Double -> Double -> Double -> Picture
thickRectangle Double
lw Double
w Double
h = Maybe SrcLoc -> Double -> Double -> Double -> Picture
ThickRectangle (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) Double
lw Double
w Double
h
circle :: HasCallStack => Double -> Picture
circle :: HasCallStack => Double -> Picture
circle = Maybe SrcLoc -> Double -> Picture
Circle (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
thickCircle :: HasCallStack => Double -> Double -> Picture
thickCircle :: HasCallStack => Double -> Double -> Picture
thickCircle = Maybe SrcLoc -> Double -> Double -> Picture
ThickCircle (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
arc :: HasCallStack => Double -> Double -> Double -> Picture
arc :: HasCallStack => Double -> Double -> Double -> Picture
arc Double
b Double
e Double
r = Maybe SrcLoc -> Double -> Double -> Double -> Picture
Arc (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) Double
b Double
e Double
r
thickArc :: HasCallStack => Double -> Double -> Double -> Double -> Picture
thickArc :: HasCallStack => Double -> Double -> Double -> Double -> Picture
thickArc Double
w Double
b Double
e Double
r = Maybe SrcLoc -> Double -> Double -> Double -> Double -> Picture
ThickArc (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) Double
b Double
e Double
r Double
w
solidCircle :: HasCallStack => Double -> Picture
solidCircle :: HasCallStack => Double -> Picture
solidCircle = Maybe SrcLoc -> Double -> Picture
SolidCircle (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
sector :: HasCallStack => Double -> Double -> Double -> Picture
sector :: HasCallStack => Double -> Double -> Double -> Picture
sector = Maybe SrcLoc -> Double -> Double -> Double -> Picture
Sector (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
lettering :: HasCallStack => Text -> Picture
lettering :: HasCallStack => Text -> Picture
lettering = Maybe SrcLoc -> Text -> Picture
Lettering (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
styledLettering :: HasCallStack => TextStyle -> Font -> Text -> Picture
styledLettering :: HasCallStack => TextStyle -> Font -> Text -> Picture
styledLettering = Maybe SrcLoc -> TextStyle -> Font -> Text -> Picture
StyledLettering (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
colored :: HasCallStack => Color -> Picture -> Picture
colored :: HasCallStack => Color -> Picture -> Picture
colored = Maybe SrcLoc -> Color -> Picture -> Picture
Color (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
coloured :: HasCallStack => Color -> Picture -> Picture
coloured :: HasCallStack => Color -> Picture -> Picture
coloured = HasCallStack => Color -> Picture -> Picture
colored
translated :: HasCallStack => Double -> Double -> Picture -> Picture
translated :: HasCallStack => Double -> Double -> Picture -> Picture
translated = Maybe SrcLoc -> Double -> Double -> Picture -> Picture
Translate (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
scaled :: HasCallStack => Double -> Double -> Picture -> Picture
scaled :: HasCallStack => Double -> Double -> Picture -> Picture
scaled = Maybe SrcLoc -> Double -> Double -> Picture -> Picture
Scale (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
dilated :: HasCallStack => Double -> Picture -> Picture
dilated :: HasCallStack => Double -> Picture -> Picture
dilated = Maybe SrcLoc -> Double -> Picture -> Picture
Dilate (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
rotated :: HasCallStack => Double -> Picture -> Picture
rotated :: HasCallStack => Double -> Picture -> Picture
rotated = Maybe SrcLoc -> Double -> Picture -> Picture
Rotate (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
reflected :: HasCallStack => Double -> Picture -> Picture
reflected :: HasCallStack => Double -> Picture -> Picture
reflected = Maybe SrcLoc -> Double -> Picture -> Picture
Reflect (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
clipped :: HasCallStack => Double -> Double -> Picture -> Picture
clipped :: HasCallStack => Double -> Double -> Picture -> Picture
clipped = Maybe SrcLoc -> Double -> Double -> Picture -> Picture
Clip (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
pictures :: HasCallStack => [Picture] -> Picture
pictures :: HasCallStack => [Picture] -> Picture
pictures = Maybe SrcLoc -> [Picture] -> Picture
Pictures (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
(&) :: HasCallStack => Picture -> Picture -> Picture
infixr 0 &
Picture
a & :: HasCallStack => Picture -> Picture -> Picture
& PictureAnd Maybe SrcLoc
loc2 [Picture]
bs
| Maybe SrcLoc -> Maybe SrcLoc -> Bool
srcContains Maybe SrcLoc
loc1 Maybe SrcLoc
loc2 = Maybe SrcLoc -> [Picture] -> Picture
PictureAnd Maybe SrcLoc
loc1 (Picture
a forall a. a -> [a] -> [a]
: [Picture]
bs)
where
loc1 :: Maybe SrcLoc
loc1 = CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack
Picture
a & Picture
b = Maybe SrcLoc -> [Picture] -> Picture
PictureAnd (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack) [Picture
a, Picture
b]
instance Monoid Picture where
mempty :: Picture
mempty = HasCallStack => Picture
blank
mconcat :: [Picture] -> Picture
mconcat = HasCallStack => [Picture] -> Picture
pictures
instance Semigroup Picture where
<> :: Picture -> Picture -> Picture
(<>) = HasCallStack => Picture -> Picture -> Picture
(&)
coordinatePlane :: HasCallStack => Picture
coordinatePlane :: HasCallStack => Picture
coordinatePlane = Maybe SrcLoc -> Picture
CoordinatePlane (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
codeWorldLogo :: HasCallStack => Picture
codeWorldLogo :: HasCallStack => Picture
codeWorldLogo =
Maybe SrcLoc -> Text -> Text -> Double -> Double -> Picture
Sketch
(CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
Text
"codeWorldLogo"
$(embedAsUrl "image/svg+xml" "data/codeworld.svg")
Double
17.68
Double
7.28
image ::
HasCallStack =>
Text ->
Text ->
Double ->
Double ->
Picture
image :: HasCallStack => Text -> Text -> Double -> Double -> Picture
image = Maybe SrcLoc -> Text -> Text -> Double -> Double -> Picture
Sketch (CallStack -> Maybe SrcLoc
getDebugSrcLoc HasCallStack => CallStack
callStack)
getDebugSrcLoc :: CallStack -> Maybe SrcLoc
getDebugSrcLoc :: CallStack -> Maybe SrcLoc
getDebugSrcLoc CallStack
cs = forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
Data.List.find ((forall a. Eq a => a -> a -> Bool
== [Char]
"main") forall b c a. (b -> c) -> (a -> b) -> a -> c
. SrcLoc -> [Char]
srcLocPackage) [SrcLoc]
locs
where
locs :: [SrcLoc]
locs = forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> b
snd (CallStack -> [([Char], SrcLoc)]
getCallStack CallStack
cs)
srcContains :: Maybe SrcLoc -> Maybe SrcLoc -> Bool
srcContains :: Maybe SrcLoc -> Maybe SrcLoc -> Bool
srcContains Maybe SrcLoc
Nothing Maybe SrcLoc
_ = Bool
False
srcContains Maybe SrcLoc
_ Maybe SrcLoc
Nothing = Bool
True
srcContains (Just SrcLoc
a) (Just SrcLoc
b) =
SrcLoc -> [Char]
srcLocFile SrcLoc
a forall a. Eq a => a -> a -> Bool
== SrcLoc -> [Char]
srcLocFile SrcLoc
b Bool -> Bool -> Bool
&& SrcLoc -> Int
srcLocStartLine SrcLoc
a forall a. Ord a => a -> a -> Bool
< SrcLoc -> Int
srcLocStartLine SrcLoc
b
Bool -> Bool -> Bool
|| ( SrcLoc -> Int
srcLocStartLine SrcLoc
a forall a. Eq a => a -> a -> Bool
== SrcLoc -> Int
srcLocStartLine SrcLoc
b
Bool -> Bool -> Bool
&& SrcLoc -> Int
srcLocStartCol SrcLoc
a forall a. Ord a => a -> a -> Bool
<= SrcLoc -> Int
srcLocStartCol SrcLoc
b
)
Bool -> Bool -> Bool
&& SrcLoc -> Int
srcLocEndLine SrcLoc
a forall a. Ord a => a -> a -> Bool
> SrcLoc -> Int
srcLocEndLine SrcLoc
b
Bool -> Bool -> Bool
|| (SrcLoc -> Int
srcLocEndLine SrcLoc
a forall a. Eq a => a -> a -> Bool
== SrcLoc -> Int
srcLocEndLine SrcLoc
b Bool -> Bool -> Bool
&& SrcLoc -> Int
srcLocEndCol SrcLoc
a forall a. Ord a => a -> a -> Bool
>= SrcLoc -> Int
srcLocEndCol SrcLoc
b)