Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ derive, fix ] Small derivation-related performance fixes #180

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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