Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- reverseRange :: (IArray a e, Ix i, Num i) => a i e -> (i, i) -> a i e
- knotRanges :: (Ix i, Num i) => (i, i) -> [Int] -> [Maybe (i, i)]
- hash :: (IArray a e, Ix i, Num i) => a i e -> [Int] -> a i e
- deriveKey :: String -> [Int]
- xorEach :: (IArray a e, Ix i, Bits e) => Int -> a i e -> [e]
- hashString :: String -> [Word8]
- day10a :: Int -> String -> Int
- day10b :: String -> String
Documentation
reverseRange :: (IArray a e, Ix i, Num i) => a i e -> (i, i) -> a i e Source #
Reverse elements of an array in a range of indices. The range may wrap.
knotRanges :: (Ix i, Num i) => (i, i) -> [Int] -> [Maybe (i, i)] Source #
Given array bounds and a list of lengths, returns a list of ranges in the array, with each one starting at an increasing distance from the end of the previous, wrapping around the ends of the array.
hash :: (IArray a e, Ix i, Num i) => a i e -> [Int] -> a i e Source #
Sequentially reverses all ranges in an array from a list of lengths.
deriveKey :: String -> [Int] Source #
Adds some magic numbers to the codepoints to a string, repeated 64 times.
xorEach :: (IArray a e, Ix i, Bits e) => Int -> a i e -> [e] Source #
Reduce consecutive groups of a fixed length by xor
.
hashString :: String -> [Word8] Source #