이 에피소드에 관해
Building on the power of functors we examine a few scenarios where a normal Functor is problematic. Fortunately, there is a closely related structure known as an Applicative Functor that can provide the capabilities to solve a broader range of problems.
Episode 17 patrons:
Chad Wooley
David Keathley
Andre Carvalho
Show Notes:
Coconut programming language: http://coconut-lang.org/
Hack nights instead of presentations: http://tech.noredink.com/post/142283641812/designing-meetups-to-build-better-communities
class Functor f => Applicative f where
pure :: Applicative f => a -> f a
ap :: Applicative f => f (a -> b) -> f a -> f b
Example of applicative usage:
pure (+) <*> Just 3 <*> Just 2 -- this results in Just 5
(+) <$> Just 3 <*> Just 2 -- this is the same as above
liftA2 (+) (Just 3) (Just 2) -- alternate form using lift instead of infix operators
Episode 17 patrons:
Chad Wooley
David Keathley
Andre Carvalho
Show Notes:
Coconut programming language: http://coconut-lang.org/
Hack nights instead of presentations: http://tech.noredink.com/post/142283641812/designing-meetups-to-build-better-communities
class Functor f => Applicative f where
pure :: Applicative f => a -> f a
ap :: Applicative f => f (a -> b) -> f a -> f b
Example of applicative usage:
pure (+) <*> Just 3 <*> Just 2 -- this results in Just 5
(+) <$> Just 3 <*> Just 2 -- this is the same as above
liftA2 (+) (Just 3) (Just 2) -- alternate form using lift instead of infix operators
영어
미국
전사 🔗
Are you the producer of this podcast?
Add a podcast transcript
Need Audio-to-Text?
Transcribe with Listen411 in Just 60 Seconds
이 팟캐스트의 다른 에피소드
Oh category theory, bastion of strange and wonderful terminology, (some might say terrible and inaccessible). Love it or hate it, you're likely to run into some terms from category theory if you spend enough time in FP land. In this episode we'll tackle some of the terms that make up the 'ism famil…
Partial application and currying are a feature that is often mysterious to the uninitiated. Why do functional programmers care about such a seemingly useless thing? Partial application is an important part of the "FP toolkit" and we'll why and provide use cases for the importance of having partial …
To write a program is to deal with uncertainty. Sometimes it feels like there's nothing we can count on and null (or undefined) is as pervasive as any other construct in our languages. However this does not have to be! LambdaCast dives into the thorny problem of null, and more broadly the potential…
Abstraction takes on a different meaning amongst functional programmers. This episode we dig into how parametric polymorphism is an essential tool in developing well behaved abstractions that transcend simply being a solution to your individual problem.
John Degoes polymorphism post
http://degoes.…
Algebraic Data Types (ADTs) are one of the most distinguishing features of statically typed functional languages. Come learn why they exist, how you can use them, and how they change your design.
Join the FP community at http://fpchat.com
Support us on Patreon at http://www.patreon.com/lambdacast…
면책 조항: 이 페이지에 포함된 팟캐스트와 작품은 LambdaCast에서 가져온 것입니다. 이 팟캐스트는 소유자의 재산이며 Listen Notes, Inc.와 제휴하거나 보증하지 않습니다.