Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,321
Issues
4,321
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
359
Merge Requests
359
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
56f36a9c
Commit
56f36a9c
authored
Jul 01, 2010
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use '==' consistently rather than '->' in examples
parent
8fb7b129
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
libraries/base/Data/List.hs
libraries/base/Data/List.hs
+6
-6
No files found.
libraries/base/Data/List.hs
View file @
56f36a9c
...
...
@@ -230,10 +230,10 @@ infix 5 \\ -- comment to fool cpp
-- It returns 'Nothing' if the list did not start with the prefix
-- given, or 'Just' the list after the prefix, if it does.
--
-- > stripPrefix "foo" "foobar"
->
Just "bar"
-- > stripPrefix "foo" "foo"
->
Just ""
-- > stripPrefix "foo" "barfoo"
->
Nothing
-- > stripPrefix "foo" "barfoobaz"
->
Nothing
-- > stripPrefix "foo" "foobar"
==
Just "bar"
-- > stripPrefix "foo" "foo"
==
Just ""
-- > stripPrefix "foo" "barfoo"
==
Nothing
-- > stripPrefix "foo" "barfoobaz"
==
Nothing
stripPrefix
::
Eq
a
=>
[
a
]
->
[
a
]
->
Maybe
[
a
]
stripPrefix
[]
ys
=
Just
ys
stripPrefix
(
x
:
xs
)
(
y
:
ys
)
...
...
@@ -297,8 +297,8 @@ isSuffixOf x y = reverse x `isPrefixOf` reverse y
--
-- Example:
--
-- >isInfixOf "Haskell" "I really like Haskell."
->
True
-- >isInfixOf "Ial" "I really like Haskell."
->
False
-- >isInfixOf "Haskell" "I really like Haskell."
==
True
-- >isInfixOf "Ial" "I really like Haskell."
==
False
isInfixOf
::
(
Eq
a
)
=>
[
a
]
->
[
a
]
->
Bool
isInfixOf
needle
haystack
=
any
(
isPrefixOf
needle
)
(
tails
haystack
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment