Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Helper functions used across the library. Do not belong to any specifig module and are not directly exported.
Synopsis
- maybeConcat :: Monoid a => [a] -> Maybe a
- seqLast :: Seq a -> a
- seqStartsWith :: Eq a => Seq a -> Seq a -> Bool
- seqCatMaybes :: Seq (Maybe a) -> Seq a
- maxNumericValue :: RealFloat a => a
- clamp :: Ord a => a -> a -> a -> a
Documentation
maybeConcat :: Monoid a => [a] -> Maybe a Source #
Concats a list of Monoids or returns Nothing if empty.
seqLast :: Seq a -> a Source #
Returns the last item in a sequence. Unsafe, fails if sequence is empty.
seqStartsWith :: Eq a => Seq a -> Seq a -> Bool Source #
Checks if the first sequence is a prefix of the second.
seqCatMaybes :: Seq (Maybe a) -> Seq a Source #
Filters Nothing instances out of a Seq, and removes the Just wrapper.
maxNumericValue :: RealFloat a => a Source #
Returns the maximum value of a given floating type.