Language: C++

{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE BangPatterns #-}

-- Default Imports

import Control.Monad
import Control.Monad.ST
import Control.Monad.Trans.Class

import qualified Control.Monad.Reader as Reader
import Control.Monad.Reader (Reader, ReaderT, runReader, runReaderT)

import qualified Data.Array.MArray as MArray
import qualified Data.Array.ST as STArray
import Data.Array.ST (STArray, STUArray, runSTArray, runSTUArray)
import Data.Ix (Ix)

import qualified Data.Bits as Bits
import Data.Bits ((.&.), (.|.))

import qualified Data.ByteString.Char8 as BS
import Data.ByteString.Char8 (ByteString)

import qualified Data.Char as Char
import qualified Data.List as List
import qualified Data.Map.Strict as Map
import Data.Map.Strict (Map)
import qualified Data.Maybe as Maybe
import qualified Data.Set as Set
import Data.Set (Set)

import qualified Data.Vector as Vector
import qualified Data.Vector.Generic as GVector
import qualified Data.Vector.Mutable as MVector
import Data.Vector.Mutable (STVector)
import qualified Data.Vector.Unboxed as UVector

import Numeric

import Debug.Trace
-- ----------

-- Custom Import Here


-- ----------

-- Default Definitions

type Vector = Vector.Vector
-- type GVector = GVector.Vector
type UVector = UVector.Vector

readIntToList :: ByteString -> [Int]
readIntToList = List.unfoldr (fmap (second $ BS.dropWhile Char.isSpace) . BS.readInt)

readToList :: Read a => ByteString -> [a]
readToList = List.unfoldr $ fmap (mapTaken . mapRemain) . span' (not . Char.isSpace)
	where
		mapTaken  = first $ read . BS.unpack
		mapRemain = second $ BS.dropWhile Char.isSpace
		span' pred s
			| BS.null taken = Nothing
			| otherwise     = Just (taken, remain')
			where
				(taken, remain) = BS.span pred s
				remain' = BS.dropWhile Char.isSpace remain

readToListN :: Read a => Int -> ByteString -> [a]
readToListN n = take n . readToList

readIntToVector :: ByteString -> Vector Int
readIntToVector = Vector.unfoldr (fmap stripRemain . BS.readInt)
	where stripRemain = second $ BS.dropWhile Char.isSpace

readIntToUVector :: ByteString -> UVector.Vector Int
readIntToUVector = UVector.unfoldr (fmap stripRemain . BS.readInt)
	where stripRemain = second $ BS.dropWhile Char.isSpace

readIntToVectorN :: Int -> ByteString -> Vector.Vector Int
readIntToVectorN n = Vector.unfoldrN n (fmap stripRemain . BS.readInt)
	where stripRemain = second $ BS.dropWhile Char.isSpace

readIntToUVectorN :: Int -> ByteString -> UVector.Vector Int
readIntToUVectorN n = UVector.unfoldrN n (fmap stripRemain . BS.readInt)
	where stripRemain = second $ BS.dropWhile Char.isSpace


first :: (a -> a') -> (a, b) -> (a', b)
first f (a, b) = (f a, b)

second :: (b -> b') -> (a, b) -> (a, b')
second f (a, b) = (a, f b)

average :: Fractional a => [a] -> a
average xs = sum xs / (fromIntegral . length) xs

-- ----------

nextv :: Vector [[Int]] -> Vector [[Int]]
nextv v = Vector.fromList $ flip map [0..9] $ \i -> let
	a :: [[Int]]
	a = if i >= 1 then map (i: ) $ v Vector.! (i - 1) else []
	b :: [[Int]]
	b = map (i: ) $ v Vector.! i
	c :: [[Int]]
	c = if i < 9 then map (i: ) $ v Vector.! (i + 1) else []
	in concat [a, b, c]

vecs = Vector.fromList (map ((: []) . (: [])) [0..9]) : vsfunc vecs
	where vsfunc (v:vs) = nextv v : vsfunc vs

vecs' = map Vector.tail vecs
ll = concatMap concat $ take 10 vecs'

main :: IO ()
main = do
	k <- readLn
	forM_ (ll !! (k - 1)) $ \i -> putStr . show $ i
	putStrLn ""


Compiler output:
a.cc:1:3: error: stray '#' in program
    1 | {-# LANGUAGE FlexibleContexts #-}
      |   ^
a.cc:1:31: error: stray '#' in program
    1 | {-# LANGUAGE FlexibleContexts #-}
      |                               ^
a.cc:2:3: error: stray '#' in program
    2 | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
      |   ^
a.cc:2:41: error: stray '#' in program
    2 | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
      |                                         ^
a.cc:3:3: error: stray '#' in program
    3 | {-# LANGUAGE Rank2Types #-}
      |   ^
a.cc:3:25: error: stray '#' in program
    3 | {-# LANGUAGE Rank2Types #-}
      |                         ^
a.cc:4:3: error: stray '#' in program
    4 | {-# LANGUAGE BinaryLiterals #-}
      |   ^
a.cc:4:29: error: stray '#' in program
    4 | {-# LANGUAGE BinaryLiterals #-}
      |                             ^
a.cc:5:3: error: stray '#' in program
    5 | {-# LANGUAGE BangPatterns #-}
      |   ^
a.cc:5:27: error: stray '#' in program
    5 | {-# LANGUAGE BangPatterns #-}
      |                           ^
a.cc:61:63: warning: missing terminating ' character
   61 | readToList = List.unfoldr $ fmap (mapTaken . mapRemain) . span' (not . Char.isSpace)
      |                                                               ^
a.cc:61:63: error: missing terminating ' character
   61 | readToList = List.unfoldr $ fmap (mapTaken . mapRemain) . span' (not . Char.isSpace)
      |                                                               ^~~~~~~~~~~~~~~~~~~~~~
a.cc:65:21: warning: missing terminating ' character
   65 |                 span' pred s
      |                     ^
a.cc:65:21: error: missing terminating ' character
   65 |                 span' pred s
      |                     ^~~~~~~~
a.cc:67:62: warning: missing terminating ' character
   67 |                         | otherwise     = Just (taken, remain')
      |                                                              ^
a.cc:67:62: error: missing terminating ' character
   67 |                         | otherwise     = Just (taken, remain')
      |                                                              ^~
a.cc:70:39: warning: missing terminating ' character
   70 |                                 remain' = BS.dropWhile Char.isSpace remain
      |                                       ^
a.cc:70:39: error: missing terminating ' character
   70 |                                 remain' = BS.dropWhile Char.isSpace remain
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:92:17: warning: multi-character literal with 17 characters exceeds 'int' size of 4 bytes
   92 | first :: (a -> a') -> (a, b) -> (a', b)
      |                 ^~~~~~~~~~~~~~~~~~~
a.cc:95:18: warning: multi-character literal with 20 characters exceeds 'int' size of 4 bytes
   95 | second :: (b -> b') -> (a, b) -> (a, b')
      |                  ^~~~~~~~~~~~~~~~~~~~~~
a.cc:104:39: error: too many decimal points in number
  104 | nextv v = Vector.fromList $ flip map [0..9] $ \i -> let
      |                                       ^~~~
a.cc:104:47: error: stray '\' in program
  104 | nextv v = Vector.fromList $ flip map [0..9] $ \i -> let
      |                                               ^
a.cc:113:48: error: too many decimal points in number
  113 | vecs = Vector.fromList (map ((: []) . (: [])) [0..9]) : vsfunc vecs
      |                                                ^~~~
a.cc:116:5: warning: missing terminating ' character
  116 | vecs' = map Vector.tail vecs
      |     ^
a.cc:116:5: error: missing terminating ' character
  116 | vecs' = map Vector.tail vecs
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:117:37: warning: missing terminating ' character
  117 | ll = concatMap concat $ take 10 vecs'
      |                                     ^
a.cc:117:37: error: missing terminating ' character
a.cc:122:33: error: stray '\' in program
  122 |         forM_ (ll !! (k - 1)) $ \i -> putStr . show $ i
      |                                 ^
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {-# LANGUAGE FlexibleContexts #-}
      | ^
a.cc:2:1: error: expected unqualified-id before '{' token
    2 | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
      | ^
a.cc:3:1: error: expected unqualified-id before '{' token
    3 | {-# LANGUAGE Rank2Types #-}
      | ^
a.cc:4:1: error: expected unqualified-id before '{' token
    4 | {-# LANGUAGE BinaryLiterals #-}
      | ^
a.cc:5:1: error: expected unqualified-id before '{' token
    5 | {-# LANGUAGE BangPatterns #-}
      | ^
a.cc:7:1: error: expected unqualified-id before '--' token
    7 | -- Default Imports
      | ^~