aoc2022/13-extra.hs

10 lines
254 B
Haskell
Raw Normal View History

2022-12-13 12:30:11 +01:00
import Data.List (intercalate)
data Node = List [Node] | Num Int
deriving (Eq)
-- here's a Show instance for Node that recreates the input:
instance Show Node where
show (List x) = "[" ++ intercalate "," (map show x) ++ "]"
show (Num n) = show n