Safe Haskell | Safe |
---|---|

Language | Haskell98 |

## Synopsis

- data T
- type ShipSize = Int
- type NumberOfShips = Int
- cumulate :: T -> T
- dec :: ShipSize -> T -> T
- inc :: ShipSize -> T -> T
- empty :: T
- fromList :: [(ShipSize, NumberOfShips)] -> T
- toList :: T -> [(ShipSize, NumberOfShips)]
- fromSizes :: [ShipSize] -> T
- toSizes :: T -> [ShipSize]
- lookup :: T -> ShipSize -> NumberOfShips
- maxSize :: Int
- singleton :: ShipSize -> NumberOfShips -> T
- subset :: T -> T -> Bool
- german :: T
- english :: T
- propList :: T -> Bool
- propSizes :: T -> Bool
- propCumulate :: Property
- propSubset :: T -> T -> Bool
- propInc :: T -> Property
- propDec :: T -> Property
- propIncDec :: T -> Property

# basics

Efficient representation of a (Map ShipSize NumberOfShips).

This is known as SIMD within a register https://en.wikipedia.org/wiki/SWAR.

type NumberOfShips = Int Source #

`lookup (cumulate fleet) size`

returns the number of all ships that are at least `size`

squares big.

# configurations for some established versions

The main configuration given in https://de.wikipedia.org/wiki/Schiffe_versenken.

The main configuration given in https://en.wikipedia.org/wiki/Battleship_(game).

# tests

propIncDec :: T -> Property Source #