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,334
Issues
4,334
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
368
Merge Requests
368
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
123ba5ef
Commit
123ba5ef
authored
Oct 27, 2012
by
ian@well-typed.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More type signature improvements from Bas van Dijk
No changes, just using nicer type variable names
parent
fda30027
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
libraries/base/Data/List.hs
libraries/base/Data/List.hs
+3
-3
No files found.
libraries/base/Data/List.hs
View file @
123ba5ef
...
...
@@ -593,7 +593,7 @@ minimumBy cmp xs = foldl1 minBy xs
-- | The 'genericLength' function is an overloaded version of 'length'. In
-- particular, instead of returning an 'Int', it returns any type which is
-- an instance of 'Num'. It is, however, less efficient than 'length'.
genericLength
::
(
Num
i
)
=>
[
b
]
->
i
genericLength
::
(
Num
i
)
=>
[
a
]
->
i
{-# NOINLINE [1] genericLength #-}
genericLength
[]
=
0
genericLength
(
_
:
l
)
=
1
+
genericLength
l
...
...
@@ -626,7 +626,7 @@ genericDrop n (_:xs) = genericDrop (n-1) xs
-- | The 'genericSplitAt' function is an overloaded version of 'splitAt', which
-- accepts any 'Integral' value as the position at which to split.
genericSplitAt
::
(
Integral
i
)
=>
i
->
[
b
]
->
([
b
],[
b
])
genericSplitAt
::
(
Integral
i
)
=>
i
->
[
a
]
->
([
a
],
[
a
])
genericSplitAt
n
xs
|
n
<=
0
=
(
[]
,
xs
)
genericSplitAt
_
[]
=
(
[]
,
[]
)
genericSplitAt
n
(
x
:
xs
)
=
(
x
:
xs'
,
xs''
)
where
...
...
@@ -634,7 +634,7 @@ genericSplitAt n (x:xs) = (x:xs',xs'') where
-- | The 'genericIndex' function is an overloaded version of '!!', which
-- accepts any 'Integral' value as the index.
genericIndex
::
(
Integral
a
)
=>
[
b
]
->
a
->
b
genericIndex
::
(
Integral
i
)
=>
[
a
]
->
i
->
a
genericIndex
(
x
:
_
)
0
=
x
genericIndex
(
_
:
xs
)
n
|
n
>
0
=
genericIndex
xs
(
n
-
1
)
...
...
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