{-# LANGUAGE FlexibleContexts, TypeFamilies #-}moduleLanguage.HERMIT.Primitive.Debug(-- * Debugging Primitivesexternals,traceR,observeR,observeFailureR)whereimportLanguage.HERMIT.KureimportLanguage.HERMIT.ExternalimportLanguage.HERMIT.Monad-- | Exposed debugging 'External's.externals::[External]externals=map(.+Debug)[external"trace"(traceR::String->RewriteHCore)["give a side-effect message as output when processing this command"],external"observe"(observeR::String->RewriteHCore)["give a side-effect message as output, and observe the value being processed"],external"observe-failure"(observeFailureR::String->RewriteHCore->RewriteHCore)["give a side-effect message if the rewrite fails, including the failing input"]]-- | If the 'Rewrite' fails, print out the 'Core', with a message.observeFailureR::(InjectionaCore,Generica~Core)=>String->RewriteHa->RewriteHaobserveFailureRstrm=m<+observeRstr-- | Print out the 'Core', with a message.observeR::(InjectionaCore,Generica~Core)=>String->RewriteHaobserveRmsg=extractR$sideEffectR$\cxtcore->sendDebugMessage$DebugCoremsgcxtcore-- | Just say something, every time the rewrite is done.traceR::String->RewriteHatraceRmsg=sideEffectR$\__->sendDebugMessage$DebugTickmsg