{- | Description: Duplicate elements in a list Copyright: Copyright (C) 2021 Yoo Chung License: GPL-3.0-or-later Maintainer: dev@chungyc.org Some solutions to "Problems.P14" of Ninety-Nine Haskell "Problems". -} module Solutions.P14 (dupli) where -- | Duplicate the elements of a list. dupli :: [a] -> [a] dupli :: forall a. [a] -> [a] dupli [] = [] dupli (a x:[a] xs) = a x a -> [a] -> [a] forall a. a -> [a] -> [a] : a x a -> [a] -> [a] forall a. a -> [a] -> [a] : [a] -> [a] forall a. [a] -> [a] dupli [a] xs