content: 
  -----------------------------------------------------------------------------
  -- |
  -- Module      :  Language.Stitch.LH.Statement
  -- Copyright   :  (C) 2015 Richard Eisenberg
  -- License     :  BSD-style (see LICENSE)
  -- Maintainer  :  Richard Eisenberg (rae@richarde.dev)
  -- Stability   :  experimental
  --
  -- Defines the Stitch Statement type, which can either be a bare
  -- expression or a global variable assignment.
  --
  ----------------------------------------------------------------------------
  
  {-# OPTIONS_GHC -Wno-unused-imports #-}
  module Language.Stitch.LH.Statement ( Statement(..), prettyStatement ) where
  
  -- XXX: Import Op so LH doesn't fail with: Unknown type constructor `ArithOp`
  import Language.Stitch.LH.Op
  import Language.Stitch.LH.Unchecked
  
  import Prettyprinter
  import Prettyprinter.Render.Terminal
  
  -- | A statement can either be a bare expression, which will be evaluated,
  -- or an assignment to a global variable.
  {-@
  data Statement = BareExp ClosedUExp
                 | NewGlobal String ClosedUExp
  @-}
  data Statement = BareExp UExp
                 | NewGlobal String UExp
    deriving Show
  
  prettyStatement :: Statement -> Doc AnsiStyle
  prettyStatement (BareExp e)     = prettyScopedUExp (ScopedUExp 0 e)
  prettyStatement (NewGlobal v e) = pretty v <+> pretty '=' <+> prettyScopedUExp (ScopedUExp 0 e)
  