Skip to content

Commit

Permalink
[ derive, fix ] Small derivation-related performance fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden authored Aug 14, 2024
2 parents 8b9347d + 13f0694 commit dfa1bd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Deriving/DepTyCheck/Gen/Core/ConsDerive.idr
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace NonObligatoryExts
maybe e pure $ lookupType lhsName -- TODO to support `lhsName` to be a type parameter of type `Type`
IPrimVal _ (PrT t) => pure $ typeInfoForPrimType t
IType _ => pure typeInfoForTypeOfTypes
lhs => failAt (getFC lhs) "Only applications to a name is supported, given \{lhs}"
lhs => failAt (getFC lhs) "Only applications to a name is supported, given \{show lhs}"
let Yes lengthCorrect = decEq ty.args.length args.length
| No _ => failAt (getFC lhs) "INTERNAL ERROR: wrong count of unapp when analysing type application"
_ <- ensureTyArgsNamed ty
Expand Down Expand Up @@ -195,6 +195,10 @@ namespace NonObligatoryExts
pure $ leftmost ++ leftToRightArgs ++ rightmost

let allOrders = if simplificationHack then take 1 allOrders else allOrders
let allOrders = List.nub $ nub <$> allOrders

for_ allOrders $ \order =>
logPoint {level=10} "least-effort.order" [sig, con] "- one of used final orders: \{show order}"

--------------------------
-- Producing the result --
Expand Down

0 comments on commit dfa1bd0

Please sign in to comment.