battleship-combinatorics-0.0.0.1: Compute number of possible arrangements in the battleship game

Safe HaskellNone
LanguageHaskell98

Combinatorics.Battleship.Count.ShortenShip.Distribution

Synopsis

Documentation

newtype Distr w h a Source #

We need to encode the height in the type since the Storable instance requires that the size of the binary data can be infered from the Distribution type.

Constructors

Distr 

Fields

Instances

(Nat w, Nat h, Storable a) => Storable (Distr w h a) Source # 

Methods

sizeOf :: Distr w h a -> Int #

alignment :: Distr w h a -> Int #

peekElemOff :: Ptr (Distr w h a) -> Int -> IO (Distr w h a) #

pokeElemOff :: Ptr (Distr w h a) -> Int -> Distr w h a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Distr w h a) #

pokeByteOff :: Ptr b -> Int -> Distr w h a -> IO () #

peek :: Ptr (Distr w h a) -> IO (Distr w h a) #

poke :: Ptr (Distr w h a) -> Distr w h a -> IO () #

Storable a => NFData (Distr w h a) Source # 

Methods

rnf :: Distr w h a -> () #

(Nat w, Nat h, C a, Storable a) => C (Distr w h a) Source # 

Methods

zero :: Distr w h a Source #

one :: Distr w h a Source #

add :: Distr w h a -> Distr w h a -> Distr w h a Source #

countFromDistr :: Storable a => Distr w h a -> a Source #

rowsFromDistr :: Storable a => Size w -> Distr w h a -> [Row w a] Source #

heightType :: Size h -> Distr w h a -> Distr w h a Source #

newtype Size2 w h Source #

Constructors

Size2 Int 

size2 :: (Nat w, Nat h) => Size2 w h Source #

sizeOfWithSize :: Storable a => Size2 w h -> Distr w h a -> Int Source #

peekWithSize :: Storable a => Size2 w h -> Ptr (Distr w h a) -> IO (Distr w h a) Source #

constant :: Storable a => Size2 w h -> a -> Distr w h a Source #

newtype Row w a Source #

Constructors

Row 

Fields

avg :: Integral a => a -> a -> a Source #

symmetric :: (Integral a, Storable a) => Row w a -> Row w a Source #

type CountDistr w h = Distr w h Count Source #

type CountDistrMap w h = T w (CountDistr w h) Source #

rowFromFrontier :: Nat w => Size w -> Count -> T w -> Row w Count Source #

reportCount :: (Nat w, Nat h) => T -> CountDistrPath w h -> IO () Source #

withReport :: (Nat w, Nat h) => Bool -> T -> (CountDistrPath w h -> IO ()) -> IOCountDistrPath w h Source #

distributionExternalList :: (Nat w, Nat h) => Size w -> Size h -> T -> IO (Count, [[Count]]) Source #