2 | module Deriving.SpecialiseData.Common
5 | import Language.Reflection.Compat
7 | %language ElabReflection
15 | data SpecialisationError : Type where
17 | TaskTypeExtractionError : SpecialisationError
19 | UnusedVarError : SpecialisationError
21 | PartialSpecError : SpecialisationError
23 | InternalError : String -> SpecialisationError
25 | UnnamedArgInLambdaError : SpecialisationError
27 | UnnamedArgInPolyTyError : Name -> SpecialisationError
32 | MissingTypeInfoError : Name -> SpecialisationError
36 | showSE : Show SpecialisationError
37 | showSE = %runElab derive
45 | record SpecialisationParams where
47 | constructor MkSpecParams
48 | eraseConNames : Bool
52 | SpecialisationDefaults : SpecialisationParams
53 | SpecialisationDefaults = MkSpecParams
54 | { eraseConNames = False
58 | interface NamespaceProvider (0 m : Type -> Type) where
59 | constructor MkNSProvider
60 | provideNS : m Namespace
63 | Monad m => MonadTrans t => NamespaceProvider m => NamespaceProvider (t m) where
64 | provideNS = lift provideNS
67 | inNS : Monad m => Namespace -> NamespaceProvider m
68 | inNS ns = MkNSProvider $
pure ns
72 | NoNS : Monad m => NamespaceProvider m
73 | NoNS = inNS (MkNS [])