Use tasty for tests, fix bug in circOnLine

This commit is contained in:
2021-12-14 11:50:01 +00:00
parent ec51efabca
commit 47391f3850
19 changed files with 143 additions and 113 deletions
+6 -5
View File
@@ -1,3 +1,4 @@
{-# LANGUAGE TupleSections #-}
module ShapePicture
( emptyBlank
, translateSPf
@@ -8,8 +9,7 @@ module ShapePicture
, noShape
, _spShape
, _spPicture
)
where
) where
import Shape
import Picture
import Geometry
@@ -18,11 +18,12 @@ import Data.Bifunctor
type SPic = (Shape, Picture)
-- should all this be inlined/inlinable?
noPic :: Shape -> SPic
noPic sh = (sh,mempty)
noPic = (,mempty)
noShape :: Picture -> SPic
noShape pic = (mempty,pic)
noShape = (mempty,)
_spShape :: SPic -> Shape
_spShape = fst
@@ -30,7 +31,7 @@ _spPicture :: SPic -> Picture
_spPicture = snd
emptyBlank :: SPic
emptyBlank = (emptySH,blank)
emptyBlank = mempty
translateSPf :: Float -> Float -> SPic -> SPic
translateSPf x y = bimap (translateSH (V3 x y 0)) (translate x y)