Сперва пример. Вот такая программа на хаскеле вычисляет и выводит ответ на жизнь, вселенную и вообще:
import Control.Applicative
main = print $ answer succ 0 where
one = pure <*> (pure :: a -> b -> a)
inc = (<*>) ((<*>) <$> pure)
mul = (<*>) <$> pure
h = mul <*> inc
answer = h . h . h $ one
Аппликативный функтор характеризуется наличием
(
Read more... )
Comments 20
Одноточечный универсальный базис слабо =) ?
Reply
Reply
Reply
Reply
Reply
(The comment has been removed)
Reply
(The comment has been removed)
Reply
(The comment has been removed)
Reply
Reply
Leave a comment