Defining ships

A ship can be either a Cruiser or a Destroyer

Cruiser is drawn as the character 'C'

Destroyer is drawn as the character 'D'

Ships can be oriented ShipVertical or ShipHorizontal

>-- Type of ship>dataShipType=Cruiser|Destroyer>>-- what character is produced by the ship type>instanceProduceCharShipTypewhere> produceChar Cruiser='C'> produceChar Destroyer='D'>>-- How is the ship oriented on the board>dataShipOrientation=ShipVertical|ShipHorizontalderiving (Show, Eq, Ord, Bounded)

A cruiser is a square with a 'circle' at the one end (looks like an arrow)

A destroyer is a thinner square with 'circle' at either ends

Notice that we define the areas covered by ships using the Monoid append operator <> over Fill areas

The resultant Fill types produce respective ShipType values for the areas where they are defined