7 _substrPS x 1 (_lengthPS x)
14 subst rexp repl flags str
15 = _unpackPS (substPS (_packString rexp)
26 str' = _packString str
28 case (findPS (_packString str) (_packString substr)) of
30 Just x -> _unpackPS (_dropPS x str')
37 str' = _packString str
39 case (rfindPS (_packString str) (_packString substr)) of
41 Just x -> _unpackPS (_dropPS x str')
44 = getArgs >>= \ (pattern:replacement:stuff:xs) ->
53 openFile xs ReadMode >>= \ hndl ->
55 _ -> return stuff) >>= \ stuff' ->
56 putStr (subst pattern replacement flags stuff') >>