Haskell/Functional identities

Aus Franky
Wechseln zu: Navigation, Suche

With my enthusiasm for distributivity as shown in Mathematik, there are some interesting functional identities in functional programming.

curry fst = const = flip (curry snd)
uncurry const = fst
uncurry (flip const) = snd
map g . map f = map (g . f)

Let b be a function T -> Bool, e.g. data T = T { b :: bool, x:: String }

length . filter id . map b = length . filter b

(downloading a new version of the haskell platform now, which allow data in ghci.)