Working element buffer object

This commit is contained in:
2021-09-20 12:36:35 +01:00
parent c605ac74ff
commit 5cbcbec101
22 changed files with 242 additions and 212 deletions
+7 -12
View File
@@ -1,19 +1,14 @@
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
--{-# LANGUAGE TemplateHaskell #-}
module ShapePicture.Data
where
import Shape
import Picture
import Control.Lens
data SPic = SPic
{ _spShape :: Shape
, _spPicture :: Picture
}
--import Control.Lens
instance Semigroup SPic where
(<>) (SPic a b) (SPic x y) = SPic (a <> x) (b <>y)
type SPic = (Shape, Picture)
instance Monoid SPic where
mempty = SPic emptySH blank
makeLenses ''SPic
_spShape :: SPic -> Shape
_spShape = fst
_spPicture :: SPic -> Picture
_spPicture = snd