Skip to content

Commit

Permalink
[ refactor ] Use external library for weak traversals
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden committed Jan 30, 2025
1 parent 03c2dad commit 041ceab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 77 deletions.
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

0 comments on commit 041ceab

Please sign in to comment.