Copyright | Copyright (C) 2021 Yoo Chung |
---|---|
License | GPL-3.0-or-later |
Maintainer | dev@chungyc.org |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Some solutions to Problems.P51 of Ninety-Nine Haskell Problems.
Documentation
corrupt :: RandomGen g => g -> Int -> [Bool] -> [Bool] Source #
Flip a given number of boolean values in the boolean list randomly.
errorCorrectingEncode :: [Bool] -> [Bool] Source #
Construct an error-correcting encoding of the given Boolean list.
Uses a reptition code of length 3.
errorCorrectingDecode :: [Bool] -> [Bool] Source #
The inverse of errorCorrectingEncode
.
Recover the original Boolean list from its encoding.
There could be an error in the encoding.