Skip to content

Commit

Permalink
[ re #210 ] Add some debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
jespercockx committed Oct 30, 2023
1 parent 0ae2778 commit 8e2f974
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Agda2Hs/Compile/Function.hs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ compileClause' :: ModuleName -> Hs.Name () -> Clause -> C (Maybe (Hs.Match ()))
compileClause' curModule x c@Clause{ clauseBody = Nothing} = return Nothing
compileClause' curModule x c@Clause{..} = do
reportSDoc "agda2hs.compile" 7 $ "compiling clause: " <+> prettyTCM c
reportSDoc "agda2hs.compile" 17 $ "Old context: " <+> (prettyTCM =<< getContext)
reportSDoc "agda2hs.compile" 17 $ "Clause telescope: " <+> prettyTCM clauseTel
addContext (KeepNames clauseTel) $ do
ps <- compilePats namedClausePats
let isWhereDecl = not . isExtendedLambdaName
Expand Down
1 change: 1 addition & 0 deletions src/Agda2Hs/Compile/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ compileTopLevelType :: Bool -> Type -> (Hs.Type () -> C a) -> C a
compileTopLevelType keepType t cont = do
reportSDoc "agda2hs.compile.type" 12 $ text "Compiling top-level type" <+> prettyTCM t
modTel <- moduleParametersToDrop =<< currentModule
reportSDoc "agda2hs.compile.type" 19 $ text "Module parameters to drop: " <+> prettyTCM modTel
go modTel cont
where
go :: Telescope -> (Hs.Type () -> C a) -> C a
Expand Down
6 changes: 5 additions & 1 deletion src/Agda2Hs/Compile/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ moduleParametersToDrop mod = do
isDatatypeModule mod >>= \case
Just _ -> return EmptyTel
Nothing -> do
reportSDoc "agda2hs.moduleParameters" 25 $ text "Current context: " <+> (prettyTCM =<< getContext)
ctxArgs <- getContextArgs
(`apply` ctxArgs) <$> lookupSection mod
reportSDoc "agda2hs.moduleParameters" 25 $ text "Context arguments: " <+> prettyTCM ctxArgs
sec <- lookupSection mod
reportSDoc "agda2hs.moduleParameters" 25 $ text "Module section: " <+> prettyTCM sec
return $ sec `apply` ctxArgs

isUnboxRecord :: QName -> C (Maybe Strictness)
isUnboxRecord q = do
Expand Down

0 comments on commit 8e2f974

Please sign in to comment.