Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more bytestring like functions #202

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions System/OsString.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module System.OsString
, encodeWith
, encodeFS
, osstr
, empty
, singleton
, pack

-- * OsString deconstruction
Expand All @@ -40,6 +42,87 @@ module System.OsString

-- * Word deconstruction
, toChar

-- * Basic interface
, snoc
, cons
, last
, tail
, uncons
, head
, init
, unsnoc
, null
, length

-- * Transforming OsString
, map
, reverse
, intercalate

-- * Reducing OsStrings (folds)
, foldl
, foldl'
, foldl1
, foldl1'
, foldr
, foldr'
, foldr1
, foldr1'

-- * Special folds
, all
, any
, concat

-- * Generating and unfolding OsStrings
, replicate
, unfoldr
, unfoldrN

-- * Substrings
-- ** Breaking strings
, take
, takeEnd
, takeWhileEnd
, takeWhile
, drop
, dropEnd
, dropWhileEnd
, dropWhile
, break
, breakEnd
, span
, spanEnd
, splitAt
, split
, splitWith
, stripSuffix
, stripPrefix

-- * Predicates
, isInfixOf
, isPrefixOf
, isSuffixOf
-- ** Search for arbitrary susbstrings
, breakSubstring

-- * Searching OsStrings
-- ** Searching by equality
, elem
, find
, filter
, partition

-- * Indexing OsStrings
, index
, indexMaybe
, (!?)
, elemIndex
, elemIndices
, count
, findIndex
, findIndices
)
where

Expand All @@ -51,10 +134,73 @@ import System.OsString.Internal
, encodeFS
, osstr
, pack
, empty
, singleton
, decodeUtf
, decodeWith
, decodeFS
, unpack
, snoc
, cons
, last
, tail
, uncons
, head
, init
, unsnoc
, null
, length
, map
, reverse
, intercalate
, foldl
, foldl'
, foldl1
, foldl1'
, foldr
, foldr'
, foldr1
, foldr1'
, all
, any
, concat
, replicate
, unfoldr
, unfoldrN
, take
, takeEnd
, takeWhileEnd
, takeWhile
, drop
, dropEnd
, dropWhileEnd
, dropWhile
, break
, breakEnd
, span
, spanEnd
, splitAt
, split
, splitWith
, stripSuffix
, stripPrefix
, isInfixOf
, isPrefixOf
, isSuffixOf
, breakSubstring
, elem
, find
, filter
, partition
, index
, indexMaybe
, (!?)
, elemIndex
, elemIndices
, count
, findIndex
, findIndices
)
import System.OsString.Internal.Types
( OsString, OsChar )
import Prelude ()
Loading