Skip to content

Commit 9605aa0

Browse files
committed
Run ormolu
1 parent e140879 commit 9605aa0

File tree

12 files changed

+33
-31
lines changed

12 files changed

+33
-31
lines changed

models/HMM.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Data.Maybe (fromJust, isJust)
1515
import Data.Vector (fromList)
1616
import Pipes (MFunctor (hoist), MonadTrans (lift), each, yield, (>->))
1717
import Pipes.Core (Producer)
18-
import qualified Pipes.Prelude as Pipes
18+
import Pipes.Prelude qualified as Pipes
1919

2020
-- | Observed values
2121
values :: [Double]

src/Control/Monad/Bayes/Inference/MCMC.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
module Control.Monad.Bayes.Inference.MCMC where
1313

1414
import Control.Monad.Bayes.Class (MonadDistribution)
15-
import qualified Control.Monad.Bayes.Traced.Basic as Basic
15+
import Control.Monad.Bayes.Traced.Basic qualified as Basic
1616
import Control.Monad.Bayes.Traced.Common
1717
( MHResult (MHResult, trace),
1818
Trace (probDensity),
1919
burnIn,
2020
mhTransWithBool,
2121
)
22-
import qualified Control.Monad.Bayes.Traced.Dynamic as Dynamic
23-
import qualified Control.Monad.Bayes.Traced.Static as Static
22+
import Control.Monad.Bayes.Traced.Dynamic qualified as Dynamic
23+
import Control.Monad.Bayes.Traced.Static qualified as Static
2424
import Control.Monad.Bayes.Weighted (Weighted, unweighted)
2525
import Pipes ((>->))
26-
import qualified Pipes as P
27-
import qualified Pipes.Prelude as P
26+
import Pipes qualified as P
27+
import Pipes.Prelude qualified as P
2828

2929
data Proposal = SingleSiteMH
3030

src/Control/Monad/Bayes/Inference/TUI.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ drawUI handleSamples state = [ui]
5757
(toDoAttr, B.progressIncompleteAttr)
5858
]
5959
)
60-
$ toBar $ fromIntegral $ numSteps state
60+
$ toBar
61+
$ fromIntegral
62+
$ numSteps state
6163

6264
likelihoodBar =
6365
updateAttrMap

src/Control/Monad/Bayes/Population.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ stratified weights = do
181181
cumulativeSum = V.scanl (+) 0.0 weights
182182
coalg (i, j)
183183
| i < bigN =
184-
if (positions ! i) < (cumulativeSum ! j)
185-
then Just (Just j, (i + 1, j))
186-
else Just (Nothing, (i, j + 1))
184+
if (positions ! i) < (cumulativeSum ! j)
185+
then Just (Just j, (i + 1, j))
186+
else Just (Nothing, (i, j + 1))
187187
| otherwise =
188-
Nothing
188+
Nothing
189189
return $ map (\i -> i - 1) $ catMaybes $ unfoldr coalg (0, 0)
190190

191191
-- | Resample the population using the underlying monad and a stratified resampling scheme.

src/Control/Monad/Bayes/Sampler/Lazy.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import System.Random
1515
getStdGen,
1616
newStdGen,
1717
)
18-
import qualified System.Random as R
18+
import System.Random qualified as R
1919

2020
-- | A 'Tree' is a lazy, infinitely wide and infinitely deep tree, labelled by Doubles
2121
-- | Our source of randomness will be a Tree, populated by uniform [0,1] choices for each label.

src/Control/Monad/Bayes/Traced/Basic.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ mh n (Traced m d) = fmap (map output . NE.toList) (f n)
8585
f k
8686
| k <= 0 = fmap (:| []) d
8787
| otherwise = do
88-
(x :| xs) <- f (k - 1)
89-
y <- mhTrans' m x
90-
return (y :| x : xs)
88+
(x :| xs) <- f (k - 1)
89+
y <- mhTrans' m x
90+
return (y :| x : xs)

src/Control/Monad/Bayes/Traced/Common.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import Control.Monad.Bayes.Class
2424
( MonadDistribution (bernoulli, random),
2525
discrete,
2626
)
27-
import qualified Control.Monad.Bayes.Density.Free as Free
28-
import qualified Control.Monad.Bayes.Density.State as State
27+
import Control.Monad.Bayes.Density.Free qualified as Free
28+
import Control.Monad.Bayes.Density.State qualified as State
2929
import Control.Monad.Bayes.Weighted as Weighted
3030
( Weighted,
3131
hoist,

src/Control/Monad/Bayes/Traced/Dynamic.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ mh n (Traced c) = do
105105
let f k
106106
| k <= 0 = return (t :| [])
107107
| otherwise = do
108-
(x :| xs) <- f (k - 1)
109-
y <- mhTransFree m x
110-
return (y :| x : xs)
108+
(x :| xs) <- f (k - 1)
109+
y <- mhTransFree m x
110+
return (y :| x : xs)
111111
fmap (map output . NE.toList) (f n)

src/Control/Monad/Bayes/Traced/Static.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@ mh n (Traced m d) = fmap (map output . NE.toList) (f n)
117117
f k
118118
| k <= 0 = fmap (:| []) d
119119
| otherwise = do
120-
(x :| xs) <- f (k - 1)
121-
y <- mhTransFree m x
122-
return (y :| x : xs)
120+
(x :| xs) <- f (k - 1)
121+
y <- mhTransFree m x
122+
return (y :| x : xs)

src/Math/Integrators/StormerVerlet.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ where
88
import Control.Lens
99
import Control.Monad.Primitive
1010
import Data.Vector (Vector, (!))
11-
import qualified Data.Vector as V
11+
import Data.Vector qualified as V
1212
import Data.Vector.Mutable
1313
import Linear (V2 (..))
1414

@@ -71,7 +71,7 @@ integrateV integrator initial times = do
7171
compute y i out
7272
| i == V.length times = return ()
7373
| otherwise = do
74-
let h = (times ! i) - (times ! (i - 1))
75-
y' = integrator h y
76-
write out i y'
77-
compute y' (i + 1) out
74+
let h = (times ! i) - (times ! (i - 1))
75+
y' = integrator h y
76+
write out i y'
77+
compute y' (i + 1) out

0 commit comments

Comments
 (0)