Haskell/Functional identities: Unterschied zwischen den Versionen
Aus Franky
Franky (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „With my enthusiasm for distributivity as shown in Mathematik, there are some interesting '''functional identities''' in functiona…“) |
(kein Unterschied)
|
Version vom 14. November 2012, 19:26 Uhr
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.)