Changeset 4866 for src/Pugs/Internals.hs
- Timestamp:
- 06/20/05 07:11:28 (4 years ago)
- svk:copy_cache_prev:
- 6641
- Files:
-
- 1 modified
-
src/Pugs/Internals.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Internals.hs
r4803 r4866 58 58 internalError, 59 59 split, 60 split_n, 60 61 breakOnGlue, 61 62 afterPrefix, … … 152 153 Nothing -> [str] 153 154 155 split_n :: (Eq a) => [a] -> [a] -> Int -> [[a]] 156 split_n [] _ n = internalError "splitting by an empty list" 157 split_n sep str n 158 | n == 1 = [str] 159 | otherwise = 160 case breakOnGlue sep str of 161 Just (before, after) -> before : split_n sep after (n-1) 162 Nothing -> [str] 163 154 164 -- returns Nothing if the glue isn't there 155 165 breakOnGlue :: (Eq a) => [a] -> [a] -> Maybe ([a], [a])
