{-# LANGUAGE TemplateHaskell #-}

module Scheme.Simplified where

import qualified Data.Set as Set
import qualified Data.Map as Map

import Data.Text (Text)
import Data.Set (Set)
import Data.Map (Map)
import Control.Lens

import Scheme.IR


type FunctionTable = Map Text Function
type NameSpace = Set Text


data Simplified = Simplified {
    _namespace :: NameSpace
  , _functions :: FunctionTable
  , _statements :: [AST]
  }


makeLenses ''Simplified


nameList (Simplified{_namespace=ns}) = Set.toList ns
funcTable (Simplified{_functions=fns}) = Map.toList fns

