ninetynine-1.3.0: Ninety-Nine Haskell Problems
CopyrightCopyright (C) 2021 Yoo Chung
LicenseGPL-3.0-or-later
Maintainerdev@chungyc.org
Safe HaskellSafe-Inferred
LanguageGHC2021

Solutions.P12

Description

Some solutions to Problems.P12 of Ninety-Nine Haskell Problems.

Synopsis

Documentation

decodeModified :: [Encoding a] -> [a] Source #

Given a run-length code list generated by encodeModified, construct its uncompressed version.

Duplicates each element as appropriate and concatenates them together.

decodeModified' :: [Encoding a] -> [a] Source #

Given a run-length code list generated by encodeModified, construct its uncompressed version.

Prepend each element as many times as required, starting from the last element prepended to an empty list, and all the way to the first element.