cookbook-3.0.1.1: Tiered general-purpose libraries with domain-specific applications.

Safe HaskellSafe
LanguageHaskell98

Cookbook.Ingredients.Lists.Encompass

Synopsis

Documentation

encompassing :: Eq a => [a] -> (a, a) -> [a] Source #

Module : Cookbook.Ingredients.Lists.Encompass Copyright : (c) 2014 by Nate Pisarski License : BSD3 Maintainer : nathanpisarski@gmail.com Stability : Stable Portability : Portable (Cookbook) Encompass is a library for parsing that is stringent on scope. It supports scope monitoring on single sets of single elements in a list, but it does not need to be a string.

Get the entire section of a list contained within the scope delimited by the parameters, even sub-scopes.

afterEncompassing :: Eq a => [a] -> (a, a) -> [a] Source #

Partial implementation of after, but working with scopes. Dangerous implementation, use with caution.

beforeEncompassing :: Eq a => [a] -> (a, a) -> [a] Source #

Partial implementation of before, but working with scopes. Less dangerous implementation than afterEncompassing, but still dangerous.

splitEncompassing :: Eq a => [a] -> (a, a) -> [[a]] Source #

Gets all of the elements outside a given scope.

toGaps :: Eq a => [[a]] -> [[a]] Source #

gatherEncompassing :: Eq a => [a] -> (a, a) -> [[a]] Source #

Returns all of the elements inside of a scope.