Skip to content

Commit

Permalink
fix order of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Sep 6, 2024
1 parent 4c7e8a7 commit e9a6009
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Juvix/Compiler/Internal/Pretty/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Juvix.Compiler.Internal.Data.NameDependencyInfo
import Juvix.Compiler.Internal.Data.TypedInstanceHole
import Juvix.Compiler.Internal.Language
import Juvix.Compiler.Internal.Pretty.Options
import Juvix.Compiler.Internal.Translation.FromInternal.Analysis.Termination.Data.SizeRelation
import Juvix.Compiler.Internal.Translation.FromInternal.Analysis.TypeChecking.CheckerNew.Arity qualified as New
import Juvix.Compiler.Store.Internal.Data.InfoTable
import Juvix.Data.CodeAnn
Expand Down Expand Up @@ -64,6 +65,9 @@ instance PrettyCode SimpleLambda where
v' <- ppCode (l ^. slambdaBinder . sbinderVar)
return $ kwSimpleLambda <+> braces (v' <+> kwAssign <+> b')

instance PrettyCode SizeRel' where
ppCode = return . annotate AnnKeyword . pretty

instance PrettyCode Application where
ppCode a = do
l' <- ppLeftExpression appFixity (a ^. appLeft)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,12 @@ mutualBlockInstanceCallMap stmts = do

addConstraint :: (Members '[CallMapBuilder' InstanceParam] r) => InstanceInfo -> InstanceApp -> Sem r ()
addConstraint InstanceInfo {..} InstanceApp {..} = do
let c :: FunCall' InstanceParam = mkFunCall cmpInstanceParam _instanceAppHead _instanceInfoParams _instanceAppArgs
let c :: FunCall' InstanceParam =
mkFunCall
(flip cmpInstanceParam)
_instanceAppHead
_instanceInfoParams
_instanceAppArgs
addCall _instanceInfoInductive c

checkInstanceTermination ::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ checkTraitTermination InstanceApp {..} InstanceInfo {..} = do
unless (any (checkStrictSubterm arg) _instanceInfoParams) $
throw (ErrTraitNotTerminating (TraitNotTerminating (paramToExpression arg)))

-- | Checks that p1 is a strict subterm of p2
checkStrictSubterm :: InstanceParam -> InstanceParam -> Bool
checkStrictSubterm p1 p2 = case p2 of
InstanceParamApp InstanceApp {..} ->
Expand Down

0 comments on commit e9a6009

Please sign in to comment.