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…“) |
Franky (Diskussion | Beiträge) K (1 Version: Import des alten wiki) |
(kein Unterschied)
|
Aktuelle Version vom 19. Januar 2014, 21:33 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.)