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

Problems.P09

Description

Part of Ninety-Nine Haskell Problems. Some solutions are in Solutions.P09.

Synopsis

Documentation

pack :: Eq a => [a] -> [[a]] Source #

Pack consecutive duplicates of list elements into sublists. If a list contains repeated elements, they should be placed in separate sublists.

Examples

>>> pack "aaaabccaadeeee"
["aaaa","b","cc","aa","d","eeee"]