Difference between revisions of "List of partial functions"

From HaskellWiki
Jump to: navigation, search
m (Moved footnote to bottom)
(List functions: Remove scanl1 and scanr1)
Line 19: Line 19:
 
* foldl1'
 
* foldl1'
 
* foldr1
 
* foldr1
* scanl1
 
* scanr1
 
 
* cycle
 
* cycle
 
* !!
 
* !!
Line 27: Line 25:
 
* product (∞)
 
* product (∞)
 
* reverse (∞)
 
* reverse (∞)
* ... (todo)
 
   
 
===Other===
 
===Other===

Revision as of 16:49, 7 February 2019

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
  • cycle
  •  !!
  • length (∞)
  • sum (∞)
  • product (∞)
  • reverse (∞)

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.