{-# OPTIONS_GHC -Wunused-imports #-}
module Agda.Compiler.Backend.Base where
import Control.DeepSeq (NFData, rnf)
import Data.Map (Map)
import Data.Text (Text)
import GHC.Generics (Generic)
import Agda.Syntax.Abstract.Name (QName)
import Agda.Syntax.Common (BackendName, IsMain, InteractionId)
import Agda.Syntax.TopLevelModuleName (TopLevelModuleName)
import Agda.Syntax.Position (Range)
import Agda.Interaction.Base (CommandM')
import Agda.Interaction.Options (OptDescr, Flag)
type BackendVersion = Text
data Backend_boot definition tcm where
Backend :: NFData opts => Backend'_boot definition tcm opts env menv mod def -> Backend_boot definition tcm
data Backend'_boot definition tcm opts env menv mod def = Backend'
{ forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def -> BackendName
backendName :: BackendName
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> Maybe BackendName
backendVersion :: Maybe BackendVersion
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def -> opts
options :: opts
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> [OptDescr (Flag opts)]
commandLineFlags :: [OptDescr (Flag opts)]
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def -> opts -> Bool
isEnabled :: opts -> Bool
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> opts -> tcm env
preCompile :: opts -> tcm env
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> env -> IsMain -> Map TopLevelModuleName mod -> tcm ()
postCompile :: env -> IsMain -> Map TopLevelModuleName mod ->
tcm ()
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> env
-> IsMain
-> TopLevelModuleName
-> Maybe FilePath
-> tcm (Recompile menv mod)
preModule :: env -> IsMain -> TopLevelModuleName ->
Maybe FilePath -> tcm (Recompile menv mod)
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> env -> menv -> IsMain -> TopLevelModuleName -> [def] -> tcm mod
postModule :: env -> menv -> IsMain -> TopLevelModuleName ->
[def] -> tcm mod
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> env -> menv -> IsMain -> definition -> tcm def
compileDef :: env -> menv -> IsMain -> definition -> tcm def
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def -> Bool
scopeCheckingSuffices :: Bool
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> QName -> tcm Bool
mayEraseType :: QName -> tcm Bool
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> Maybe (BackendCommandTop tcm)
backendInteractTop :: Maybe (BackendCommandTop tcm)
, forall definition (tcm :: * -> *) opts env menv mod def.
Backend'_boot definition tcm opts env menv mod def
-> Maybe (BackendCommandHole tcm)
backendInteractHole :: Maybe (BackendCommandHole tcm)
}
deriving (forall x.
Backend'_boot definition tcm opts env menv mod def
-> Rep (Backend'_boot definition tcm opts env menv mod def) x)
-> (forall x.
Rep (Backend'_boot definition tcm opts env menv mod def) x
-> Backend'_boot definition tcm opts env menv mod def)
-> Generic (Backend'_boot definition tcm opts env menv mod def)
forall x.
Rep (Backend'_boot definition tcm opts env menv mod def) x
-> Backend'_boot definition tcm opts env menv mod def
forall x.
Backend'_boot definition tcm opts env menv mod def
-> Rep (Backend'_boot definition tcm opts env menv mod def) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall definition (tcm :: * -> *) opts env menv mod def x.
Rep (Backend'_boot definition tcm opts env menv mod def) x
-> Backend'_boot definition tcm opts env menv mod def
forall definition (tcm :: * -> *) opts env menv mod def x.
Backend'_boot definition tcm opts env menv mod def
-> Rep (Backend'_boot definition tcm opts env menv mod def) x
$cfrom :: forall definition (tcm :: * -> *) opts env menv mod def x.
Backend'_boot definition tcm opts env menv mod def
-> Rep (Backend'_boot definition tcm opts env menv mod def) x
from :: forall x.
Backend'_boot definition tcm opts env menv mod def
-> Rep (Backend'_boot definition tcm opts env menv mod def) x
$cto :: forall definition (tcm :: * -> *) opts env menv mod def x.
Rep (Backend'_boot definition tcm opts env menv mod def) x
-> Backend'_boot definition tcm opts env menv mod def
to :: forall x.
Rep (Backend'_boot definition tcm opts env menv mod def) x
-> Backend'_boot definition tcm opts env menv mod def
Generic
data Recompile menv mod = Recompile menv | Skip mod
type CommandPayload = String
type BackendCommandTop tcm
= CommandPayload
-> CommandM' tcm ()
type BackendCommandHole tcm
= CommandPayload
-> InteractionId
-> Range
-> String
-> CommandM' tcm ()
instance NFData (Backend_boot definition tcm) where
rnf :: Backend_boot definition tcm -> ()
rnf (Backend Backend'_boot definition tcm opts env menv mod def
b) = Backend'_boot definition tcm opts env menv mod def -> ()
forall a. NFData a => a -> ()
rnf Backend'_boot definition tcm opts env menv mod def
b
instance NFData opts => NFData (Backend'_boot definition tcm opts env menv mod def) where
rnf :: Backend'_boot definition tcm opts env menv mod def -> ()
rnf (Backend' BackendName
a Maybe BackendName
b opts
c [OptDescr (Flag opts)]
d opts -> Bool
e opts -> tcm env
f env -> IsMain -> Map TopLevelModuleName mod -> tcm ()
g env
-> IsMain
-> TopLevelModuleName
-> Maybe FilePath
-> tcm (Recompile menv mod)
h env -> menv -> IsMain -> TopLevelModuleName -> [def] -> tcm mod
i env -> menv -> IsMain -> definition -> tcm def
j Bool
k QName -> tcm Bool
l !Maybe (BackendCommandTop tcm)
m !Maybe (BackendCommandHole tcm)
n) =
BackendName -> ()
forall a. NFData a => a -> ()
rnf BackendName
a () -> () -> ()
forall a b. a -> b -> b
`seq`
Maybe BackendName -> ()
forall a. NFData a => a -> ()
rnf Maybe BackendName
b () -> () -> ()
forall a b. a -> b -> b
`seq`
opts -> ()
forall a. NFData a => a -> ()
rnf opts
c () -> () -> ()
forall a b. a -> b -> b
`seq`
Bool -> ()
forall a. NFData a => a -> ()
rnf Bool
k () -> () -> ()
forall a b. a -> b -> b
`seq`
()