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

[ refactor ] Use external library for weak traversals #20

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
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
70 changes: 0 additions & 70 deletions src/Data/Functor/TraverseSt.idr

This file was deleted.

8 changes: 4 additions & 4 deletions src/Statistics/Confidence.idr
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ checkCoverageConditions' coverageTests = traverseSt initialResults checkCoverage
initialResults : PastResults
initialResults = R 0 $ coverageTests <&> const (0 `Element` LTEZero)

checkCoverageOnce : a -> PastResults -> (PastResults, Vect n CoverageTestState)
checkCoverageOnce x $ R prevAttempts prevResults = do
checkCoverageOnce : PastResults -> a -> (PastResults, Vect n CoverageTestState)
checkCoverageOnce (R prevAttempts prevResults) x = do
let %inline currAttempts : Nat; currAttempts = S prevAttempts
mapFst (R currAttempts) $ unzip $ coverageTests `zip` prevResults <&>
\(Cover checkedP@(minP, maxP) cond, Element prevSucc _) => do
Expand Down Expand Up @@ -217,7 +217,7 @@ checkCoverageConditions :
Vect n (CoverageTest a) ->
t a ->
t $ Vect n CoverageTestResult
checkCoverageConditions = map @{FromTraversableSt} (map coverageTestResult) .: checkCoverageConditions' {confidence}
checkCoverageConditions = map @{Compose} coverageTestResult .: checkCoverageConditions' {confidence}

export %inline
checkCoverageCondition :
Expand All @@ -227,4 +227,4 @@ checkCoverageCondition :
CoverageTest a ->
t a ->
t CoverageTestResult
checkCoverageCondition ct = map @{FromTraversableSt} head . checkCoverageConditions {confidence} [ct]
checkCoverageCondition ct = map head . checkCoverageConditions {confidence} [ct]
5 changes: 2 additions & 3 deletions summary-stat.ipkg
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ license = "Apache-2.0"
brief = "Facilities for summary statistics"

modules
= Data.Functor.TraverseSt

, Statistics.Confidence
= Statistics.Confidence
, Statistics.Erf
, Statistics.Norm
, Statistics.Norm.Precise
Expand All @@ -24,3 +22,4 @@ builddir = ".build"
langversion >= 0.7.0

depends = bounded-doubles
, weaker-traversals