  Complete The Pattern # 2
-- 

module Haskell.Codewars.Pattern where

import Data.List (inits, intercalate)

pattern :: Int -> String
pattern n = intercalate "\n" 
          . map ( foldl (\acc x -> acc ++ show x) "" ) 
          . reverse . tail . inits $ [n, n-1..1]

  Complete The Pattern # 2

module Haskell.Codewars.Pattern where

import Data.List (inits, intercalate)

pattern :: Int -> String
pattern n = intercalate "\n" 
          . map ( foldl (\acc x -> acc ++ show x) "" ) 
          . reverse . tail . inits $ [n, n-1..1]
