Skip to content

Commit

Permalink
add missinghaddock documents for Interval, lowerBound' and upperBound'
Browse files Browse the repository at this point in the history
  • Loading branch information
msakai committed Oct 22, 2019
1 parent eff55a7 commit 7084d20
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Data/Interval/Internal.hs
Expand Up @@ -33,6 +33,7 @@ instance NFData Boundary

instance Hashable Boundary

-- | The intervals (/i.e./ connected and convex subsets) over real numbers __R__.
data Interval r
= Whole
| Empty
Expand All @@ -47,6 +48,9 @@ data Interval r
| BothOpen !r !r
deriving (Eq, Generic, Typeable)

-- | Lower endpoint (/i.e./ greatest lower bound) of the interval,
-- together with 'Boundary' information.
-- The result is convenient to use as an argument for 'interval'.
lowerBound' :: Interval r -> (Extended r, Boundary)
lowerBound' = \case
Whole -> (NegInf, Open)
Expand All @@ -61,6 +65,9 @@ lowerBound' = \case
RightOpen p _ -> (Finite p, Closed)
BothOpen p _ -> (Finite p, Open)

-- | Upper endpoint (/i.e./ least upper bound) of the interval,
-- together with 'Boundary' information.
-- The result is convenient to use as an argument for 'interval'.
upperBound' :: Interval r -> (Extended r, Boundary)
upperBound' = \case
Whole -> (PosInf, Open)
Expand Down

0 comments on commit 7084d20

Please sign in to comment.