Difference between revisions of "List of partial functions"
Jump to navigation
Jump to search
m (Moved footnote to bottom) |
|||
(15 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
==Partial functions in Prelude== |
==Partial functions in Prelude== |
||
+ | |||
+ | ===Functions that aren't even partial=== |
||
+ | |||
+ | * error |
||
+ | * undefined |
||
===List functions=== |
===List functions=== |
||
Line 9: | Line 14: | ||
* init |
* init |
||
* last |
* last |
||
⚫ | |||
⚫ | |||
* foldl1 |
* foldl1 |
||
* foldl1' |
* foldl1' |
||
− | * foldl1 |
||
* foldr1 |
* foldr1 |
||
+ | * scanl1 |
||
+ | * scanr1 |
||
* cycle |
* cycle |
||
* !! |
* !! |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | * product (∞) |
||
⚫ | |||
+ | * reverse (∞) |
||
− | * foldl1 |
||
− | * foldr1 |
||
⚫ | |||
⚫ | |||
* ... (todo) |
* ... (todo) |
||
− | |||
− | ===Maybe functions=== |
||
− | |||
− | * fromJust |
||
===Other=== |
===Other=== |
||
Line 37: | Line 38: | ||
* mod |
* mod |
||
* divMod |
* divMod |
||
+ | * succ |
||
+ | * pred |
||
+ | * toEnum |
||
+ | * (^) |
||
+ | * fail |
||
* ... (todo) |
* ... (todo) |
||
==Partial functions in other base libraries== |
==Partial functions in other base libraries== |
||
+ | ===Data.List=== |
||
− | ... (todo) |
||
+ | |||
⚫ | |||
+ | * genericLength (∞) |
||
+ | |||
+ | ===Data.Map=== |
||
+ | |||
+ | * (!) |
||
===Data.Maybe=== |
===Data.Maybe=== |
||
Line 50: | Line 63: | ||
... (todo) |
... (todo) |
||
+ | |||
+ | NB. Functions marked with (∞) are partial because the function will not terminate if given an infinite list. |
Revision as of 01:14, 4 November 2015
Partial functions in Prelude
Functions that aren't even partial
- error
- undefined
List functions
- maximum
- minimum
- head
- tail
- init
- last
- foldl (∞)
- foldl' (∞)
- foldl1
- foldl1'
- foldr1
- scanl1
- scanr1
- cycle
- !!
- length (∞)
- sum (∞)
- product (∞)
- reverse (∞)
- ... (todo)
Other
- read
- quot
- rem
- quotRem
- div
- mod
- divMod
- succ
- pred
- toEnum
- (^)
- fail
- ... (todo)
Partial functions in other base libraries
Data.List
- genericIndex
- genericLength (∞)
Data.Map
- (!)
Data.Maybe
- fromJust
Partial functions in other Haskell Platform packages
... (todo)
NB. Functions marked with (∞) are partial because the function will not terminate if given an infinite list.