codeworld-tasks
Safe HaskellNone
LanguageHaskell2010

CodeWorld

Description

Module exporting the same interface as provided in the CodeWorld editor.

Synopsis

CodeWorld API

The CodeWorld Picture type and corresponding API for composing images.

data Picture Source #

Student facing, basic picture type. A value of this type can be build using the CodeWorld API.

CodeWorld.Test also exports pattern synonyms for all contained constructors. This allows for easier pattern matching in generic traversals.

Instances

Instances details
MuRef Picture Source # 
Instance details

Defined in CodeWorld.Tasks.Picture

Associated Types

type DeRef Picture 
Instance details

Defined in CodeWorld.Tasks.Picture

type DeRef Picture = ReifyPicture

Methods

mapDeRef :: Applicative f => (forall b. (MuRef b, DeRef Picture ~ DeRef b) => b -> f u) -> Picture -> f (DeRef Picture u)

NFData Picture Source # 
Instance details

Defined in CodeWorld.Tasks.Picture

Methods

rnf :: Picture -> () #

Data Picture Source # 
Instance details

Defined in CodeWorld.Tasks.Picture

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Picture -> c Picture #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Picture #

toConstr :: Picture -> Constr #

dataTypeOf :: Picture -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Picture) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Picture) #

gmapT :: (forall b. Data b => b -> b) -> Picture -> Picture #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Picture -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Picture -> r #

gmapQ :: (forall d. Data d => d -> u) -> Picture -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Picture -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Picture -> m Picture #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Picture -> m Picture #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Picture -> m Picture #

Generic Picture Source # 
Instance details

Defined in CodeWorld.Tasks.Picture

Associated Types

type Rep Picture 
Instance details

Defined in CodeWorld.Tasks.Picture

type Rep Picture = D1 ('MetaData "Picture" "CodeWorld.Tasks.Picture" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'True) (C1 ('MetaCons "PRec" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ReifyPicture Picture))))

Methods

from :: Picture -> Rep Picture x #

to :: Rep Picture x -> Picture #

Show Picture Source # 
Instance details

Defined in CodeWorld.Tasks.Picture

Eq Picture Source # 
Instance details

Defined in CodeWorld.Tasks.Picture

Methods

(==) :: Picture -> Picture -> Bool #

(/=) :: Picture -> Picture -> Bool #

Ord Picture Source # 
Instance details

Defined in CodeWorld.Tasks.Picture

type DeRef Picture Source # 
Instance details

Defined in CodeWorld.Tasks.Picture

type DeRef Picture = ReifyPicture
type Rep Picture Source # 
Instance details

Defined in CodeWorld.Tasks.Picture

type Rep Picture = D1 ('MetaData "Picture" "CodeWorld.Tasks.Picture" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'True) (C1 ('MetaCons "PRec" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ReifyPicture Picture))))

(&) :: Picture -> Picture -> Picture Source #

Compose two Pictures. The left argument will be drawn on top of the right argument if they overlap.

arc :: Double -> Double -> Double -> Picture Source #

Draw a thin, hollow circle segment with these start and end angles and radius.

blank :: Picture Source #

An empty Picture. This is the identity element of &.

circle :: Double -> Picture Source #

Draw a hollow, thin circle with this radius.

clipped :: Double -> Double -> Picture -> Picture Source #

Clip the image in a rectangle with this length and height.

closedCurve :: [Point] -> Picture Source #

Same as curve but adds another splice between the start and end points to close the shape.

:: Picture Source #

A static image of the CodeWorld logo.

colored :: Color -> Picture -> Picture Source #

Apply this Color to the image.

coordinatePlane :: Picture Source #

A static image of a coordinate plane extending 5 units in all directions.

curve :: [Point] -> Picture Source #

Draw a thin curve passing through the provided points via a number of Bézier splices.

dilated :: Double -> Picture -> Picture Source #

Scale the image in both directions using the same modifier.

lettering :: Text -> Picture Source #

Render this text into an image.

pictures :: [Picture] -> Picture Source #

Compose a list of Pictures. Equivalent to foldr (&) blank.

polygon :: [Point] -> Picture Source #

Same as polyline but adds another segment between the start and end points to close the shape.

polyline :: [Point] -> Picture Source #

Draw a sequence of thin line segments passing through the provided points.

rectangle :: Double -> Double -> Picture Source #

Draw a hollow, thin rectangle with this length and height.

reflected :: Double -> Picture -> Picture Source #

Reflect the image across a line through the origin with this angle to the x-axis.

rotated :: Double -> Picture -> Picture Source #

Rotate the image around the origin using this angle in radians.

scaled :: Double -> Double -> Picture -> Picture Source #

Scale the image in x and y-directions using these modifiers.

sector :: Double -> Double -> Double -> Picture Source #

Draw a filled in circle segment with these start and end angles and radius. This would be solidArc following the usual naming scheme.

solidCircle :: Double -> Picture Source #

Draw a filled in circle with this radius.

solidClosedCurve :: [Point] -> Picture Source #

Draw a curve passing through the provided points via a number of Bézier splices. Adds another splice between the start and end points to close the shape and completely fills the enclosed area.

solidPolygon :: [Point] -> Picture Source #

Draw a sequence of line segments with this line width passing through the provided points and completely fill the enclosed area.

solidRectangle :: Double -> Double -> Picture Source #

Draw a filled in rectangle with this length and height.

styledLettering :: TextStyle -> Font -> Text -> Picture Source #

Render this text into an image using the provided TextStyle and Font.

thickArc :: Double -> Double -> Double -> Double -> Picture Source #

Draw a hollow circle segment with this line width, these start and end angles and radius. Specifying a negative line width causes a runtime error (mirrors behaviour in CodeWorld editor).

thickCircle :: Double -> Double -> Picture Source #

Draw a hollow circle with this line width and radius. Specifying a negative line width or a line width greater than the circles diameter causes a runtime error (mirrors behaviour in CodeWorld editor).

thickClosedCurve :: Double -> [Point] -> Picture Source #

Same as thickCurve but adds another splice between the start and end points to close the shape.

thickCurve :: Double -> [Point] -> Picture Source #

Draw a curve with this line width passing through the provided points via a number of Bézier splices. Specifying a negative line width causes a runtime error (mirrors behaviour in CodeWorld editor).

thickPolygon :: Double -> [Point] -> Picture Source #

Same as thickPolyline but adds another segment between the start and end points to close the shape.

thickPolyline :: Double -> [Point] -> Picture Source #

Draw a sequence of line segments with this line width passing through the provided points. Specifying a negative line width causes a runtime error (mirrors behaviour in CodeWorld editor).

thickRectangle :: Double -> Double -> Double -> Picture Source #

Draw a hollow rectangle with this line width, length and height. Specifying a negative line width causes a runtime error (mirrors behaviour in CodeWorld editor).

translated :: Double -> Double -> Picture -> Picture Source #

Move the image in x and y-direction.

Colours

data Color Source #

Color type mirroring CodeWorld's equivalent type. The exposed constructors allow for setting colors directly via numerical values.

Constructors

RGB Double Double Double

Values for red, green, blue given as a percentage from 0 to 1

HSL Double Double Double

Values for hue, saturation and luminosity

RGBA Double Double Double Double

RGB with an additional transparency percentage

Instances

Instances details
NFData Color Source # 
Instance details

Defined in CodeWorld.Tasks.Color

Methods

rnf :: Color -> () #

Data Color Source # 
Instance details

Defined in CodeWorld.Tasks.Color

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Color -> c Color #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Color #

toConstr :: Color -> Constr #

dataTypeOf :: Color -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Color) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Color) #

gmapT :: (forall b. Data b => b -> b) -> Color -> Color #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Color -> r #

gmapQ :: (forall d. Data d => d -> u) -> Color -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Color -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Color -> m Color #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Color -> m Color #

Generic Color Source # 
Instance details

Defined in CodeWorld.Tasks.Color

Associated Types

type Rep Color 
Instance details

Defined in CodeWorld.Tasks.Color

type Rep Color = D1 ('MetaData "Color" "CodeWorld.Tasks.Color" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) ((((C1 ('MetaCons "Yellow" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Green" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Red" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Blue" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Orange" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Brown" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Pink" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Purple" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Grey" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "White" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Black" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Bright" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)))))) :+: (((C1 ('MetaCons "Brighter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: (C1 ('MetaCons "Dull" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: C1 ('MetaCons "Duller" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)))) :+: (C1 ('MetaCons "Light" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: (C1 ('MetaCons "Lighter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: C1 ('MetaCons "Dark" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color))))) :+: ((C1 ('MetaCons "Darker" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: (C1 ('MetaCons "Translucent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: C1 ('MetaCons "Mixed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Color])))) :+: ((C1 ('MetaCons "RGB" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: C1 ('MetaCons "HSL" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))) :+: (C1 ('MetaCons "RGBA" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: C1 ('MetaCons "AnyColor" 'PrefixI 'False) (U1 :: Type -> Type))))))

Methods

from :: Color -> Rep Color x #

to :: Rep Color x -> Color #

Show Color Source # 
Instance details

Defined in CodeWorld.Tasks.Color

Methods

showsPrec :: Int -> Color -> ShowS #

show :: Color -> String #

showList :: [Color] -> ShowS #

Eq Color Source # 
Instance details

Defined in CodeWorld.Tasks.Color

Methods

(==) :: Color -> Color -> Bool #

(/=) :: Color -> Color -> Bool #

Ord Color Source # 
Instance details

Defined in CodeWorld.Tasks.Color

Methods

compare :: Color -> Color -> Ordering #

(<) :: Color -> Color -> Bool #

(<=) :: Color -> Color -> Bool #

(>) :: Color -> Color -> Bool #

(>=) :: Color -> Color -> Bool #

max :: Color -> Color -> Color #

min :: Color -> Color -> Color #

type Rep Color Source # 
Instance details

Defined in CodeWorld.Tasks.Color

type Rep Color = D1 ('MetaData "Color" "CodeWorld.Tasks.Color" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) ((((C1 ('MetaCons "Yellow" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Green" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Red" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Blue" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Orange" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Brown" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Pink" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Purple" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Grey" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "White" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Black" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Bright" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)))))) :+: (((C1 ('MetaCons "Brighter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: (C1 ('MetaCons "Dull" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: C1 ('MetaCons "Duller" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)))) :+: (C1 ('MetaCons "Light" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: (C1 ('MetaCons "Lighter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: C1 ('MetaCons "Dark" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color))))) :+: ((C1 ('MetaCons "Darker" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: (C1 ('MetaCons "Translucent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color)) :+: C1 ('MetaCons "Mixed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Color])))) :+: ((C1 ('MetaCons "RGB" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: C1 ('MetaCons "HSL" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))) :+: (C1 ('MetaCons "RGBA" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: C1 ('MetaCons "AnyColor" 'PrefixI 'False) (U1 :: Type -> Type))))))

alpha :: Color -> Double Source #

Returns the transparency of the argument.

assortedColors :: [Color] Source #

An infinite list of different colours.

black :: Color Source #

Constant basic colour.

blue :: Color Source #

Constant basic colour.

bright :: Color -> Color Source #

Slightly increase argument's saturation.

brighter :: Double -> Color -> Color Source #

Increase argument's saturation by a user defined amount.

brown :: Color Source #

Constant basic colour.

dark :: Color -> Color Source #

Slightly decrease argument's luminosity.

darker :: Double -> Color -> Color Source #

Decrease argument's luminosity by a user defined amount.

dull :: Color -> Color Source #

Slightly decrease argument's saturation.

duller :: Double -> Color -> Color Source #

Decrease argument's saturation by a user defined amount.

gray :: Color Source #

Alias for grey.

green :: Color Source #

Constant basic colour.

grey :: Color Source #

Constant basic colour.

hue :: Color -> Double Source #

Returns the hue of the argument according to the HSL model.

light :: Color -> Color Source #

Slightly increase argument's luminosity.

lighter :: Double -> Color -> Color Source #

Increase argument's luminosity by a user defined amount.

luminosity :: Color -> Double Source #

Returns the luminosity of the argument according to the HSL model.

mixed :: [Color] -> Color Source #

Blend a new color from the arguments.

orange :: Color Source #

Constant basic colour.

pink :: Color Source #

Constant basic colour.

purple :: Color Source #

Constant basic colour.

red :: Color Source #

Constant basic colour.

saturation :: Color -> Double Source #

Returns the saturation of the argument according to the HSL model.

translucent :: Color -> Color Source #

Slightly increase argument's transparency.

white :: Color Source #

Constant basic colour.

yellow :: Color Source #

Constant basic colour.

type Colour = Color Source #

Alias for Color.

Math Utility

dilatedPoint :: Double -> Point -> Point Source #

Dilates a point by given uniform scaling factor. Dilating by a negative factor also reflects across the origin.

reflectedPoint :: Double -> Point -> Point Source #

Reflects a point across a line through the origin at this angle from the X-axis.

rotatedPoint :: Double -> Point -> Point Source #

Rotates a point around the origin by the given angle in radians.

rotatedVector :: Double -> Vector -> Vector Source #

Rotates a vector by the given angle in radians.

scaledPoint :: Double -> Double -> Point -> Point Source #

Scales a point by given X and Y scaling factor. Scaling by a negative factor also reflects across that axis.

scaledVector :: Double -> Double -> Vector -> Vector Source #

Scales a vector by the given scalar multiplier.

translatedPoint :: Double -> Double -> Point -> Point Source #

Moves a point in X and Y-directions.

vectorDifference :: Vector -> Vector -> Vector Source #

The difference of two vectors.

vectorDirection :: Vector -> Double Source #

The counter-clockwise angle of a vector from the X-axis.

vectorLength :: Vector -> Double Source #

The length of a vector.

vectorSum :: Vector -> Vector -> Vector Source #

The sum of two vectors.

type Point = (Double, Double) Source #

A point in 2D space. Synonym for a pair of Double values.

type Vector = (Double, Double) Source #

A vector in 2D space. Synonym for a pair of Double values.

Text Rendering Modifiers

data Font Source #

Text font type used for stylized message rendering.

Instances

Instances details
NFData Font Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

rnf :: Font -> () #

Data Font Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Font -> c Font #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Font #

toConstr :: Font -> Constr #

dataTypeOf :: Font -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Font) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Font) #

gmapT :: (forall b. Data b => b -> b) -> Font -> Font #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Font -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Font -> r #

gmapQ :: (forall d. Data d => d -> u) -> Font -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Font -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Font -> m Font #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Font -> m Font #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Font -> m Font #

Generic Font Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Associated Types

type Rep Font 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep Font = D1 ('MetaData "Font" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) ((C1 ('MetaCons "SansSerif" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Serif" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Monospace" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Handwriting" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Fancy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NamedFont" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))))

Methods

from :: Font -> Rep Font x #

to :: Rep Font x -> Font #

Show Font Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

showsPrec :: Int -> Font -> ShowS #

show :: Font -> String #

showList :: [Font] -> ShowS #

Eq Font Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

(==) :: Font -> Font -> Bool #

(/=) :: Font -> Font -> Bool #

Ord Font Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

compare :: Font -> Font -> Ordering #

(<) :: Font -> Font -> Bool #

(<=) :: Font -> Font -> Bool #

(>) :: Font -> Font -> Bool #

(>=) :: Font -> Font -> Bool #

max :: Font -> Font -> Font #

min :: Font -> Font -> Font #

type Rep Font Source # 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep Font = D1 ('MetaData "Font" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) ((C1 ('MetaCons "SansSerif" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Serif" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Monospace" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Handwriting" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Fancy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NamedFont" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))))

data ReifyPicture a Source #

Basic syntax tree type of the CodeWorld API. Each API function has a corresponding constructor.

The type variable is necessary for CSE detection via Reify. The method replaces subexpressions with number ids, so we need to be flexible in the wrapped type.

Instances

Instances details
Foldable ReifyPicture Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

fold :: Monoid m => ReifyPicture m -> m #

foldMap :: Monoid m => (a -> m) -> ReifyPicture a -> m #

foldMap' :: Monoid m => (a -> m) -> ReifyPicture a -> m #

foldr :: (a -> b -> b) -> b -> ReifyPicture a -> b #

foldr' :: (a -> b -> b) -> b -> ReifyPicture a -> b #

foldl :: (b -> a -> b) -> b -> ReifyPicture a -> b #

foldl' :: (b -> a -> b) -> b -> ReifyPicture a -> b #

foldr1 :: (a -> a -> a) -> ReifyPicture a -> a #

foldl1 :: (a -> a -> a) -> ReifyPicture a -> a #

toList :: ReifyPicture a -> [a] #

null :: ReifyPicture a -> Bool #

length :: ReifyPicture a -> Int #

elem :: Eq a => a -> ReifyPicture a -> Bool #

maximum :: Ord a => ReifyPicture a -> a #

minimum :: Ord a => ReifyPicture a -> a #

sum :: Num a => ReifyPicture a -> a #

product :: Num a => ReifyPicture a -> a #

NFData a => NFData (ReifyPicture a) Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

rnf :: ReifyPicture a -> () #

Data a => Data (ReifyPicture a) Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ReifyPicture a -> c (ReifyPicture a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ReifyPicture a) #

toConstr :: ReifyPicture a -> Constr #

dataTypeOf :: ReifyPicture a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ReifyPicture a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ReifyPicture a)) #

gmapT :: (forall b. Data b => b -> b) -> ReifyPicture a -> ReifyPicture a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ReifyPicture a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ReifyPicture a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ReifyPicture a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ReifyPicture a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ReifyPicture a -> m (ReifyPicture a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ReifyPicture a -> m (ReifyPicture a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ReifyPicture a -> m (ReifyPicture a) #

Generic (ReifyPicture a) Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Associated Types

type Rep (ReifyPicture a) 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep (ReifyPicture a) = D1 ('MetaData "ReifyPicture" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) ((((C1 ('MetaCons "Rectangle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: C1 ('MetaCons "Circle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: (C1 ('MetaCons "Polyline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Shape) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Point])) :+: C1 ('MetaCons "Arc" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))))) :+: ((C1 ('MetaCons "Curve" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Shape) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Point])) :+: C1 ('MetaCons "Lettering" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "StyledLettering" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TextStyle) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Font) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "Color" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Translate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))))))) :+: (((C1 ('MetaCons "Scale" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) :+: C1 ('MetaCons "Dilate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) :+: (C1 ('MetaCons "Rotate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons "Reflect" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Clip" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))))) :+: ((C1 ('MetaCons "Pictures" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])) :+: C1 ('MetaCons "And" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) :+: (C1 ('MetaCons "CoordinatePlane" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Logo" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Blank" 'PrefixI 'False) (U1 :: Type -> Type))))))

Methods

from :: ReifyPicture a -> Rep (ReifyPicture a) x #

to :: Rep (ReifyPicture a) x -> ReifyPicture a #

Show a => Show (ReifyPicture a) Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Eq a => Eq (ReifyPicture a) Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Ord a => Ord (ReifyPicture a) Source # 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep (ReifyPicture a) Source # 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep (ReifyPicture a) = D1 ('MetaData "ReifyPicture" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) ((((C1 ('MetaCons "Rectangle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: C1 ('MetaCons "Circle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: (C1 ('MetaCons "Polyline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Shape) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Point])) :+: C1 ('MetaCons "Arc" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))))) :+: ((C1 ('MetaCons "Curve" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Shape) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Point])) :+: C1 ('MetaCons "Lettering" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "StyledLettering" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TextStyle) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Font) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "Color" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Color) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Translate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))))))) :+: (((C1 ('MetaCons "Scale" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) :+: C1 ('MetaCons "Dilate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) :+: (C1 ('MetaCons "Rotate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons "Reflect" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Clip" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))))) :+: ((C1 ('MetaCons "Pictures" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])) :+: C1 ('MetaCons "And" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) :+: (C1 ('MetaCons "CoordinatePlane" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Logo" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Blank" 'PrefixI 'False) (U1 :: Type -> Type))))))

data Shape Source #

Constructors

Closed Style 
Open (Maybe Double) 

Instances

Instances details
NFData Shape Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

rnf :: Shape -> () #

Data Shape Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Shape -> c Shape #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Shape #

toConstr :: Shape -> Constr #

dataTypeOf :: Shape -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Shape) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Shape) #

gmapT :: (forall b. Data b => b -> b) -> Shape -> Shape #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Shape -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Shape -> r #

gmapQ :: (forall d. Data d => d -> u) -> Shape -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Shape -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Shape -> m Shape #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Shape -> m Shape #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Shape -> m Shape #

Generic Shape Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Associated Types

type Rep Shape 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep Shape = D1 ('MetaData "Shape" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) (C1 ('MetaCons "Closed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style)) :+: C1 ('MetaCons "Open" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double))))

Methods

from :: Shape -> Rep Shape x #

to :: Rep Shape x -> Shape #

Show Shape Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

showsPrec :: Int -> Shape -> ShowS #

show :: Shape -> String #

showList :: [Shape] -> ShowS #

Eq Shape Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

(==) :: Shape -> Shape -> Bool #

(/=) :: Shape -> Shape -> Bool #

Ord Shape Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

compare :: Shape -> Shape -> Ordering #

(<) :: Shape -> Shape -> Bool #

(<=) :: Shape -> Shape -> Bool #

(>) :: Shape -> Shape -> Bool #

(>=) :: Shape -> Shape -> Bool #

max :: Shape -> Shape -> Shape #

min :: Shape -> Shape -> Shape #

type Rep Shape Source # 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep Shape = D1 ('MetaData "Shape" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) (C1 ('MetaCons "Closed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style)) :+: C1 ('MetaCons "Open" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double))))

data Style Source #

Constructors

Outline (Maybe Double) 
Solid 

Instances

Instances details
NFData Style Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

rnf :: Style -> () #

Data Style Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Style -> c Style #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Style #

toConstr :: Style -> Constr #

dataTypeOf :: Style -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Style) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Style) #

gmapT :: (forall b. Data b => b -> b) -> Style -> Style #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r #

gmapQ :: (forall d. Data d => d -> u) -> Style -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Style -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Style -> m Style #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style #

Generic Style Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Associated Types

type Rep Style 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep Style = D1 ('MetaData "Style" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) (C1 ('MetaCons "Outline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double))) :+: C1 ('MetaCons "Solid" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Style -> Rep Style x #

to :: Rep Style x -> Style #

Show Style Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

showsPrec :: Int -> Style -> ShowS #

show :: Style -> String #

showList :: [Style] -> ShowS #

Eq Style Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

(==) :: Style -> Style -> Bool #

(/=) :: Style -> Style -> Bool #

Ord Style Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

compare :: Style -> Style -> Ordering #

(<) :: Style -> Style -> Bool #

(<=) :: Style -> Style -> Bool #

(>) :: Style -> Style -> Bool #

(>=) :: Style -> Style -> Bool #

max :: Style -> Style -> Style #

min :: Style -> Style -> Style #

type Rep Style Source # 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep Style = D1 ('MetaData "Style" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) (C1 ('MetaCons "Outline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double))) :+: C1 ('MetaCons "Solid" 'PrefixI 'False) (U1 :: Type -> Type))

data TextStyle Source #

Font modifier type used for stylized message rendering.

Constructors

Plain 
Bold 
Italic 

Instances

Instances details
NFData TextStyle Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

rnf :: TextStyle -> () #

Data TextStyle Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TextStyle -> c TextStyle #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TextStyle #

toConstr :: TextStyle -> Constr #

dataTypeOf :: TextStyle -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TextStyle) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TextStyle) #

gmapT :: (forall b. Data b => b -> b) -> TextStyle -> TextStyle #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TextStyle -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TextStyle -> r #

gmapQ :: (forall d. Data d => d -> u) -> TextStyle -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TextStyle -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TextStyle -> m TextStyle #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TextStyle -> m TextStyle #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TextStyle -> m TextStyle #

Generic TextStyle Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Associated Types

type Rep TextStyle 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep TextStyle = D1 ('MetaData "TextStyle" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) (C1 ('MetaCons "Plain" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Bold" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Italic" 'PrefixI 'False) (U1 :: Type -> Type)))
Show TextStyle Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Eq TextStyle Source # 
Instance details

Defined in CodeWorld.Tasks.Types

Ord TextStyle Source # 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep TextStyle Source # 
Instance details

Defined in CodeWorld.Tasks.Types

type Rep TextStyle = D1 ('MetaData "TextStyle" "CodeWorld.Tasks.Types" "codeworld-tasks-0.1.0.0-HDTRBEVOXsr1YTQ9DZ9YSS" 'False) (C1 ('MetaCons "Plain" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Bold" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Italic" 'PrefixI 'False) (U1 :: Type -> Type)))

CodeWorld IO Interface

Entry points for rendering. Defining the main function in terms of one of these would draw the provided image to screen.

All of these are dummy functions (no-op IO actions) as this library does not implement the actual rendering process.

drawingOf :: Picture -> IO () Source #

Render a Picture onto the canvas.

animationOf :: (Double -> Picture) -> IO () Source #

Render an animation onto the canvas.

trace :: Text -> a -> a Source #

Prints a debug message in the console when second argument is evaluated.