Hoogle Search

Within LTS Haskell 24.34 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. fortuneCookie :: Fake Text

    fakedata Faker.Quote

    No documentation available.

  2. formation :: Fake Text

    fakedata Faker.Sport.Volleyball

    No documentation available.

  3. package formatn

    Formatting of doubles. This package provides support for number formatting styles, especially styles involving significant figure calculations.

    Usage

    >>> import Data.FormatN
    
    >>> comma (Just 3) 1234
    1,230
    

  4. format :: FormatStyle -> Maybe Int -> Double -> Text

    formatn Data.FormatN

    format a number according to a FormatStyle and significant figures

    >>> format CommaStyle (Just 2) 1234
    "1,200"
    

  5. formatN :: FormatN -> Double -> Text

    formatn Data.FormatN

    run a FormatN

    >>> formatN defaultFormatN 1234
    "1,200"
    

  6. formatNs :: FormatN -> [Double] -> [Text]

    formatn Data.FormatN

    Consistently format a list of numbers via using distinguish.

    >>> formatNs defaultFormatN [0,1,1.01,1.02,1.1,1.2]
    ["0.00","1.00","1.01","1.02","1.10","1.20"]
    

  7. formatOrShow :: FormatStyle -> Maybe Int -> Double -> Text

    formatn Data.FormatN

    Format with the shorter of show and a style.

    >>> format (ExponentStyle Nothing) Nothing 0
    "0e0"
    
    >>> formatOrShow (ExponentStyle Nothing) Nothing 0
    "0"
    

  8. formatSF :: FormatStyle -> SigFig -> Text

    formatn Data.FormatN

    format a SigFig according to a style

    >>> formatSF CommaStyle (toSigFig (Just 2) 1234)
    "1,200"
    
    >>> formatSF CommaStyle (SigFig SigFigPos 0 1)
    "0"
    
    >>> formatSF CommaStyle (SigFig SigFigPos 0 (-1))
    "0.0"
    

  9. formats :: Bool -> Bool -> (Double -> FormatStyle) -> Maybe Int -> [Double] -> [Text]

    formatn Data.FormatN

    Consistently format a list of numbers,using the minimum number of decimal places or minimum exponent.

    >>> formats True True precStyle (Just 1) [0,0.5,1,2]
    ["0.0","0.5","1.0","2.0"]
    
    Note how the presence of 0.5 in the example above changes the format of all numbers. Without it:
    >>> formats True True precStyle (Just 1) [0,1,2]
    ["0","1","2"]
    
    >>> formats False True precStyle (Just 1) $ ((-1)*) <$> [0,0.5,1,2]
    ["0.0","-0.5","-1.0","-2.0"]
    
    >>> formats True True commaPrecStyle (Just 1) $ ((-1000)*) <$> [0,0.5,1,2]
    ["     0","  -500","-1,000","-2,000"]
    
    >>> formats True True commaPrecStyle (Just 1) $ ((1e6)*) <$> [0,0.5,1,2]
    ["        0","  500,000","1,000,000","2,000,000"]
    
    >>> formats True True commaPrecStyle (Just 1) $ ((1e6)*) <$> [0.9,2,3]
    ["0.9e6","2.0e6","3.0e6"]
    
    >>> formats True True commaPrecStyle (Just 1) $ ((1e-6)*) <$> [0,0.5,1,2]
    ["0.0e-6","0.5e-6","1.0e-6","2.0e-6"]
    
    >>> formats True True commaPrecStyle (Just 1) $ ((1e-3)*) <$> [0,0.5,1,2]
    ["0.0000","0.0005","0.0010","0.0020"]
    
    >>> formats True False (const (ExponentStyle Nothing)) (Just 2) [0..4]
    ["0.0e0","1.0e0","2.0e0","3.0e0","4.0e0"]
    
    >>> formats True True (const (ExponentStyle Nothing)) (Just 2) [0..4]
    ["0e0","1e0","2e0","3e0","4e0"]
    

  10. formatsSF :: Maybe Int -> [Double] -> [SigFig]

    formatn Data.FormatN

    Consistently convert a list of numbers to SigFigs, using the minimum natural exponent of the list.

Page 138 of many | Previous | Next