{-# LANGUAGE TemplateHaskell #-}
module Clash.Normalize.Types where
import qualified Control.Lens as Lens
import Control.Monad.State.Strict (State)
import Data.Map (Map)
import Data.Set (Set)
import Data.Text (Text)
import Clash.Core.Term (Term)
import Clash.Core.Type (Type)
import Clash.Core.Var (Id)
import Clash.Core.VarEnv (VarEnv)
import Clash.Driver.Types (BindingMap)
import Clash.Rewrite.Types (Rewrite, RewriteMonad)
data NormalizeState
= NormalizeState
{ NormalizeState -> BindingMap
_normalized :: BindingMap
, NormalizeState -> Map (Id, Int, Either Term Type) Id
_specialisationCache :: Map (Id,Int,Either Term Type) Id
, NormalizeState -> VarEnv Int
_specialisationHistory :: VarEnv Int
, NormalizeState -> VarEnv (VarEnv Int)
_inlineHistory :: VarEnv (VarEnv Int)
, NormalizeState -> Map Text (Set Int)
_primitiveArgs :: Map Text (Set Int)
, NormalizeState -> VarEnv Bool
_recursiveComponents :: VarEnv Bool
}
Lens.makeLenses ''NormalizeState
type NormalizeMonad = State NormalizeState
type NormalizeSession = RewriteMonad NormalizeState
type NormRewrite = Rewrite NormalizeState
data TermClassification
= TermClassification
{ TermClassification -> Int
_function :: !Int
, TermClassification -> Int
_primitive :: !Int
, TermClassification -> Int
_selection :: !Int
}
deriving Int -> TermClassification -> ShowS
[TermClassification] -> ShowS
TermClassification -> String
(Int -> TermClassification -> ShowS)
-> (TermClassification -> String)
-> ([TermClassification] -> ShowS)
-> Show TermClassification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TermClassification] -> ShowS
$cshowList :: [TermClassification] -> ShowS
show :: TermClassification -> String
$cshow :: TermClassification -> String
showsPrec :: Int -> TermClassification -> ShowS
$cshowsPrec :: Int -> TermClassification -> ShowS
Show
Lens.makeLenses ''TermClassification