@@ -30,9 +30,9 @@ module Data.Number.Format
3030
3131import Prelude
3232
33- foreign import toPrecisionNative ∷ Int → Number → String
34- foreign import toFixedNative ∷ Int → Number → String
35- foreign import toExponentialNative ∷ Int → Number → String
33+ foreign import toPrecisionNative :: Int -> Number -> String
34+ foreign import toFixedNative :: Int -> Number -> String
35+ foreign import toExponentialNative :: Int -> Number -> String
3636
3737-- | The `Format` data type specifies how a number will be formatted.
3838data Format
@@ -42,21 +42,21 @@ data Format
4242
4343-- | Create a `toPrecision`-based format from an integer. Values smaller than
4444-- | `1` and larger than `21` will be clamped.
45- precision ∷ Int → Format
45+ precision :: Int -> Format
4646precision = Precision <<< clamp 1 21
4747
4848-- | Create a `toFixed`-based format from an integer. Values smaller than `0`
4949-- | and larger than `20` will be clamped.
50- fixed ∷ Int → Format
50+ fixed :: Int -> Format
5151fixed = Fixed <<< clamp 0 20
5252
5353-- | Create a `toExponential`-based format from an integer. Values smaller than
5454-- | `0` and larger than `20` will be clamped.
55- exponential ∷ Int → Format
55+ exponential :: Int -> Format
5656exponential = Exponential <<< clamp 0 20
5757
5858-- | Convert a number to a string with a given format.
59- toStringWith ∷ Format → Number → String
59+ toStringWith :: Format -> Number -> String
6060toStringWith (Precision p) = toPrecisionNative p
6161toStringWith (Fixed p) = toFixedNative p
6262toStringWith (Exponential p) = toExponentialNative p
@@ -73,4 +73,4 @@ toStringWith (Exponential p) = toExponentialNative p
7373-- | > toString 1.2e-10
7474-- | "1.2e-10"
7575-- | ```
76- foreign import toString ∷ Number → String
76+ foreign import toString :: Number -> String
0 commit comments