


{-# LANGUAGE FlexibleInstances #-}


-- ghc options


{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- {-# OPTIONS_GHC -fno-warn-name-shadowing #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}
-- {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
-- {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
-- {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
-- {-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}



-- |
-- Copyright :  (c) Andreas Reuleaux 2015
-- License   :  BSD2
-- Maintainer:  Andreas Reuleaux <rx@a-rx.info>
-- Stability :  experimental
-- Portability: non-portable
--
-- This module provides pretty printing functionality for Pire's
-- abstract and concrete syntax: names




module Pire.Pretty.Nm where


import Pire.Syntax.Nm

-- import Data.Text as T
import Text.PrettyPrint as TPP

import Pire.Pretty.Common
import Pire.Pretty.Ws()



-- instance Disp s => Disp (Nm_ s) where
--   disp (Nm_ nm (Ws ws)) = do
--     dnm <- disp nm
--     return $ dnm <> (text $ T.unpack ws)


instance Disp s => Disp (Nm1 s) where

  disp (Nm1 nm) = disp nm
  
  disp (Nm1_ nm ws) = do
    dnm <- disp nm
    dws <- disp ws
    return $ dnm <> dws



instance Disp s => Disp (Nm s s) where

  disp (Nm nm) = disp nm
  
  disp (Nm_ nm ws) = do
    dnm <- disp nm
    dws <- disp ws
    return $ dnm <> dws

