Skip to content

Commit

Permalink
Move common summary functionality to Data.Summary.Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
patperry committed Sep 16, 2010
1 parent a0fcbeb commit a36ed51
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
1 change: 1 addition & 0 deletions examples/Binomial.hs
Expand Up @@ -7,6 +7,7 @@ import Text.Printf( printf )

import Control.Monad.MC
import Data.Summary
import Data.Summary.Utils( inInterval )

-- | Sample from a binomial distribution with the given parameters.
binomial :: (MonadMC m) => Int -> Double -> m Int
Expand Down
3 changes: 2 additions & 1 deletion examples/Pi.lhs
Expand Up @@ -6,7 +6,8 @@ of them fall in the unit circle.
\begin{code}
import Control.Monad( liftM, liftM2 )
import Control.Monad.MC( MC, uniform, replicateMC, evalMC, mt19937 )
import Data.Summary.Bool( summary, sampleMean, sampleSE, interval )
import Data.Summary.Bool( summary, sampleMean, sampleSE )
import Data.Summary.Utils( interval )
import Text.Printf
\end{code}

Expand Down
6 changes: 2 additions & 4 deletions lib/Data/Summary/Bool.hs
Expand Up @@ -22,15 +22,13 @@ module Data.Summary.Bool (
sampleSE,
sampleCI,

-- * Confidence intervals
module Data.Summary.Common,

) where

import Data.List( foldl' )
import Text.Printf

import Data.Summary.Common
import Data.Summary.Utils


-- | A type for storing summary statistics for a data set of
-- booleans. Specifically, this just keeps track of the number
Expand Down
5 changes: 1 addition & 4 deletions lib/Data/Summary/Double.hs
Expand Up @@ -25,15 +25,12 @@ module Data.Summary.Double (
sampleSD,
sampleCI,

-- * Confidence intervals
module Data.Summary.Common,

) where

import Data.List( foldl' )
import Text.Printf

import Data.Summary.Common
import Data.Summary.Utils


-- | A type for storing summary statistics for a data set including
Expand Down
6 changes: 4 additions & 2 deletions lib/Data/Summary/Utils.hs
@@ -1,13 +1,15 @@
-----------------------------------------------------------------------------
-- |
-- Module : Data.Summary.Common
-- Module : Data.Summary.Utils
-- Copyright : Copyright (c) , Patrick Perry <patperry@stanford.edu>
-- License : BSD3
-- Maintainer : Patrick Perry <patperry@stanford.edu>
-- Stability : experimental
--
-- Utilities for data summaries.
--

module Data.Summary.Common (
module Data.Summary.Utils (
interval,
inInterval,
) where
Expand Down
4 changes: 2 additions & 2 deletions monte-carlo.cabal
Expand Up @@ -23,18 +23,18 @@ library
exposed-modules:
Control.Monad.MC
Control.Monad.MC.Class
Control.Monad.MC.GSL
Data.Summary
Data.Summary.Bool
Data.Summary.Double
Data.Summary.Utils

other-modules:
Control.Monad.MC.Base
Control.Monad.MC.GSL
Control.Monad.MC.GSLBase
Control.Monad.MC.Repeat
Control.Monad.MC.Sample
Control.Monad.MC.Walker
Data.Summary.Common

extensions:
FlexibleInstances,
Expand Down

0 comments on commit a36ed51

Please sign in to comment.