Copyright | (c) Marcus Völker 2017 |
---|---|

License | MIT |

Maintainer | marcus.voelker@rwth-aachen.de |

Safe Haskell | Safe |

Language | Haskell2010 |

This module contains the `TokenStream`

class, an abstraction of lists, similar to `Traversable`

, but geared for use with LParse

- class (Functor t, Foldable t) => TokenStream t where
- skipN :: TokenStream s => Int -> s a -> s a
- sDrop :: TokenStream s => Int -> s a -> s a
- sZip :: TokenStream s => s a -> s b -> s (a, b)
- sZipWith :: TokenStream s => (a -> b -> c) -> s a -> s b -> s c
- sFilter :: TokenStream s => (a -> Bool) -> s a -> s a

# Documentation

class (Functor t, Foldable t) => TokenStream t where Source #

`TokenStream`

abstracts a list, i.e., something that has a next element to process and a rest afterwards

`nil`

gives the empty `TokenStream`

. Similar to `[]`

cons :: a -> t a -> t a Source #

`cons`

prepends an element to the `TokenStream`

. Similar to `(:)`

TokenStream [] Source # | |

TokenStream Maybe Source # | |

TokenStream (Either a) Source # | |

skipN :: TokenStream s => Int -> s a -> s a Source #

Deprecated: Use sDrop in place of skipN

Deprecated version of `sDrop`

sDrop :: TokenStream s => Int -> s a -> s a Source #

`TokenStream`

version of `drop`

sZip :: TokenStream s => s a -> s b -> s (a, b) Source #

`TokenStream`

version of `zip`

sZipWith :: TokenStream s => (a -> b -> c) -> s a -> s b -> s c Source #

`TokenStream`

version of `zipWith`

sFilter :: TokenStream s => (a -> Bool) -> s a -> s a Source #

`TokenStream`

version of `filter`