packages feed

phino-0.0.0.9 / src / Printer.hs

-- SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com-- SPDX-License-Identifier: MITmodule Printer whereimport Astimport Pretty (prettyProgram)import XMIR (programToXMIR, printXMIR)data PrintFormat = XMIR | PHI  deriving (Eq)instance Show PrintFormat where  show XMIR = "xmir"  show PHI = "phi"printProgram :: Program -> PrintFormat -> IO StringprintProgram prog PHI = pure (prettyProgram prog)printProgram prog XMIR = do  xmir <- programToXMIR prog  pure (printXMIR xmir)