http://deni-ok.livejournal.com/ ([identity profile] deni-ok.livejournal.com) wrote in [personal profile] deniok 2009-10-23 07:39 pm (UTC)

Ну и зря.
Это же чистая алгебра; и полно автоматических средств для "туда-сюда":
 > pl \x y -> x + 1
 const . (1 +)
 
 > unpl const . (1 +)
 (\ e _ -> 1 + e)
 
 > pl \v1 v2 -> sum (zipWith (*) v1 v2)
 (sum .) . zipWith (*)
 
 > unpl (sum .) . zipWith (*)
 (\ d g -> sum (zipWith (*) d g))
 
 > pl \x y z -> f (g x y z)
 ((f .) .) . g
 
 > unpl ((f .) .) . g
 (\ e j m -> f (g e j m))
 
 > pl \x y z -> f (g x y) z
 (f .) . g
 
 > unpl (f .) . g
 (\ d i -> f (g d i))
Можешь вделать в IDE "преобразовальщик под предпочтительный вид", если есть нужда ;-)

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting