Safe Haskell | None |
---|---|

Language | Haskell98 |

`NRT`

operations.

## Synopsis

- insertBy_post :: (a -> a -> Ordering) -> a -> [a] -> [a]
- insert_post :: Bundle -> [Bundle] -> [Bundle]
- at_last :: (a -> b) -> (a -> b) -> [a] -> [b]
- nrt_merge :: NRT -> NRT -> NRT
- nrt_merge_set :: [NRT] -> NRT
- nrt_empty :: NRT
- nrt_insert_pre :: Bundle -> NRT -> NRT
- nrt_insert_post :: Bundle -> NRT -> NRT
- nrt_end_time :: NRT -> Time
- bundle_map :: (Time -> Time) -> ([Message] -> [Message]) -> Bundle -> Bundle
- nrt_close :: NRT -> NRT
- nrt_append :: NRT -> NRT -> NRT

# List

insertBy_post :: (a -> a -> Ordering) -> a -> [a] -> [a] Source #

Inserts at the first position where it compares less but not equal to the next element.

import Data.Function insertBy (compare `on` fst) (3,'x') (zip [1..5] ['a'..]) insertBy_post (compare `on` fst) (3,'x') (zip [1..5] ['a'..])

insert_post :: Bundle -> [Bundle] -> [Bundle] Source #

`insertBy_post`

using `compare`

.

at_last :: (a -> b) -> (a -> b) -> [a] -> [b] Source #

Apply *f* at all but last element, and *g* at last element.

at_last (* 2) negate [1..4] == [2,4,6,-4]

# NRT

nrt_end_time :: NRT -> Time Source #

`bundleTime`

of `last`

of `nrt_bundles`

.

bundle_map :: (Time -> Time) -> ([Message] -> [Message]) -> Bundle -> Bundle Source #

Apply temporal and message functions to bundle.