Delete cruft, add Reader monad to some internal ai

This commit is contained in:
jgk
2021-05-16 21:42:11 +02:00
parent 0798cc0b0e
commit d7fcdbf550
69 changed files with 721 additions and 2894 deletions
+9 -9
View File
@@ -120,7 +120,7 @@ extrapolate (ox,oy) (ax,ay) (bx,by) (x,y) =
color :: RGBA -> Picture -> Picture
{-# INLINE color #-}
color c pic = OverPic id id 0 (const c) pic
color c = OverPic id id 0 (const c)
translate3 :: Float -> Float -> Point3 -> Point3
{-# INLINE translate3 #-}
@@ -128,15 +128,15 @@ translate3 a b (x,y,z) = (x+a,y+b,z)
translate :: Float -> Float -> Picture -> Picture
{-# INLINE translate #-}
translate x y pic = OverPic (translate3 x y) id 0 id pic
translate x y = OverPic (translate3 x y) id 0 id
setDepth :: Float -> Picture -> Picture
{-# INLINE setDepth #-}
setDepth d pic = OverPic (\(x,y,_) -> (x,y,d)) id 0 id pic
setDepth d = OverPic (\(x,y,_) -> (x,y,d)) id 0 id
setLayer :: Int -> Picture -> Picture
{-# INLINE setLayer #-}
setLayer i pic = OnLayer i pic
setLayer = OnLayer
scale3 :: Float -> Float -> Point3 -> Point3
{-# INLINE scale3 #-}
@@ -144,7 +144,7 @@ scale3 a b (x,y,z) = (x*a,y*b,z)
scale :: Float -> Float -> Picture -> Picture
{-# INLINE scale #-}
scale x y pic = OverPic (scale3 x y) (\(a,b) ->(a*x,b*y)) 0 id pic
scale x y = OverPic (scale3 x y) (\(a,b) ->(a*x,b*y)) 0 id
rotate3 :: Float -> Point3 -> Point3
{-# INLINE rotate3 #-}
@@ -154,7 +154,7 @@ rotate3 a (x,y,z) = (x',y',z)
rotate :: Float -> Picture -> Picture
{-# INLINE rotate #-}
rotate a pic = OverPic (rotate3 a) id a id pic
rotate a = OverPic (rotate3 a) id a id
pictures :: [Picture] -> Picture
{-# INLINE pictures #-}
@@ -162,9 +162,9 @@ pictures = Pictures
makeArc :: Float -> (Float,Float) -> [Point2]
{-# INLINE makeArc #-}
makeArc rad (a,b) = zipWith rotateV as (repeat (0,rad))
makeArc rad (a,b) = map (`rotateV` (0,rad)) angles
where
as = [a,a+step.. b]
angles = [a,a+step.. b]
step = pi * 0.2
circleSolid :: Float -> Picture
@@ -203,7 +203,7 @@ thickLine ps t = pictures $ f ps
thickCircle :: Float -> Float -> Picture
{-# INLINE thickCircle #-}
thickCircle rad wdth = thickArc 0 (2*pi) rad wdth
thickCircle = thickArc 0 (2*pi)
arcSolid :: Float -> Float -> Float -> Picture
{-# INLINE arcSolid #-}