Safe Haskell | None |
---|---|
Language | Haskell2010 |
Test.Goblin.Persist
Description
Utilities for reading from / writing to the filesystem
Synopsis
- decodePopulation :: ByteString -> Population Bool
- encodePopulation :: Population Bool -> ByteString
- readFirstGenomeFromFile :: FilePath -> IO [Bool]
- readPopulationFromFile :: FilePath -> IO (Population Bool)
- writePopulationToFile :: FilePath -> Population Bool -> IO ()
- loadBestPopToShownByteString :: FilePath -> Q Exp
- loadGoblinDataFromFilePath :: FilePath -> Q Exp
- integralToBits :: FiniteBits a => a -> [Bool]
- integralFromBits :: forall a. (Integral a, FiniteBits a) => [Bool] -> a
- padBits :: Int -> [Bool] -> ([Bool], Int)
- splitter :: ([Word64], Int) -> [Bool]
- grouper :: [Bool] -> ([Word64], Int)
Documentation
decodePopulation :: ByteString -> Population Bool Source #
Decode a `Population Bool` from a lazy ByteString.
encodePopulation :: Population Bool -> ByteString Source #
Encode a `Population Bool` to a lazy ByteString.
readFirstGenomeFromFile :: FilePath -> IO [Bool] Source #
Load a Population from a file and return the first (highest scoring) genome.
readPopulationFromFile :: FilePath -> IO (Population Bool) Source #
Read a Population from a file.
writePopulationToFile :: FilePath -> Population Bool -> IO () Source #
Write a Population to a file.
loadBestPopToShownByteString :: FilePath -> Q Exp Source #
Read a file at compile-time, and splice in the show
of its ByteString
as a String in the source file.
integralToBits :: FiniteBits a => a -> [Bool] Source #
Convert an Integral into a little-endian binary representation.
integralFromBits :: forall a. (Integral a, FiniteBits a) => [Bool] -> a Source #
Convert from a little-endian binary representation to an Integral.
padBits :: Int -> [Bool] -> ([Bool], Int) Source #
Returns the padded list, plus the number of padding bits added.