Functional Programming in JavaScript How to improve your JavaScript programs using functional techniques 1 edition Edition Luis Atencio download
Functional Programming in JavaScript How to improve your JavaScript programs using functional techniques 1 edition Edition Luis Atencio download
https://textbookfull.com/product/functional-programming-in-
javascript-how-to-improve-your-javascript-programs-using-
functional-techniques-first-edition-luis-atencio/
https://textbookfull.com/product/beginning-functional-javascript-
functional-programming-with-javascript-using-ecmascript-6-1st-
edition-anto-aravinth/
https://textbookfull.com/product/beginning-functional-javascript-
functional-programming-with-javascript-using-ecmascript-6-1st-
edition-anto-aravinth-2/
https://textbookfull.com/product/the-joy-of-javascript-1st-
edition-luis-atencio/
Beginning Functional JavaScript: Uncover the Concepts
of Functional Programming with EcmaScript 8 2nd Edition
Srikanth Machiraju
https://textbookfull.com/product/beginning-functional-javascript-
uncover-the-concepts-of-functional-programming-with-
ecmascript-8-2nd-edition-srikanth-machiraju/
https://textbookfull.com/product/the-joy-of-javascript-1st-
edition-atencio/
https://textbookfull.com/product/head-first-javascript-
programming-2nd-edition-a-learners-guide-to-modern-javascript-
eric-freeman/
https://textbookfull.com/product/head-first-javascript-
programming-2nd-edition-a-learners-guide-to-modern-javascript-
eric-freeman-2/
Functional Programming in JavaScript
Functional
Programming
in JavaScript
LUIS ATENCIO
MANNING
SHELTER ISLAND
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: [email protected]
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial caps
or all caps.
Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books
are printed on paper that is at least 15 percent recycled and processed without the use of
elemental chlorine.
ISBN: 9781617292828
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 – EBM – 21 20 19 18 17 16
To my wonderful wife, Ana.
Thank you for your unconditional support
and for being the source of passion and inspiration in my life.
brief contents
PART 1 THINK FUNCTIONALLY ..................................................1
1 ■ Becoming functional 3
2 ■ Higher-order JavaScript 23
vii
contents
preface xv
acknowledgments xvii
about this book xix
1 Becoming functional
1.1
3
Can functional programming help? 5
1.2 What is functional programming? 5
Functional programming is declarative 7 Pure functions and
■
ix
x CONTENTS
2 Higher-order JavaScript 23
2.1 Why JavaScript? 24
2.2 Functional vs. object-oriented programming 24
Managing the state of JavaScript objects 31 Treating objects ■
of closures 50
2.5 Summary 53
programming 111
4.6 Managing control flow with functional combinators 112
Identity (I-combinator) 112 Tap (K-combinator) 113
■
null-checking 121
5.2 Building a better solution: functors 121
Wrapping unsafe values 122 ■ Functors explained 124
5.3 Functional error handling using monads 127
Monads: from control flow to data flow 128 Error handling with
■
dependencies 164
6.4 Capturing specifications with property-based testing 166
6.5 Measuring effectiveness through code coverage 172
Measuring the effectiveness of testing functional code 173
Measuring the complexity of functional code 177
6.6 Summary 179
xv
xvi PREFACE
xvii
xviii ACKNOWLEDGMENTS
On the technical side, special thanks to Dean Iverson, who served as the book’s
technical editor; Daniel Lamb, who served as the book’s technical proofreader; and
Brian Hanafee, for his thorough and in-depth evaluation of the entire book. They are
the best technical editors I could have hoped for.
Last but not least, I thank my wife for always supporting me, and my family for
pushing me to become better every day and not asking why I didn’t call as often to
check in while I was writing this book. Also, thanks go to my colleagues at work for
purchasing early releases of the chapters. I am grateful to have the pleasure of work-
ing alongside such wonderful people.
about this book
Complexity is a huge beast to tame, and we’ll never get rid of it entirely; it will always
be an aspect of software development. I’ve spent countless hours and immeasurable
brainpower trying to understand what a particular piece of code does. The secret is to
control the complexity so it doesn’t grow in proportion to the size of your code base—
and functional programming can help. We’re writing more JavaScript than ever before.
We’ve gone from building small client-side event-handling routines, to heavy client-
side architectures, to complete isomorphic (server + client) JavaScript applications.
Functional programming isn’t a tool—it’s a way of thinking that can apply equally to
any of these environments.
This book is designed to teach you how to apply functional programming tech-
niques to your code using ECMAScript 6 JavaScript. The material is presented at a
gradual, steady pace and covers both theoretical and practical aspects of functional
programming. I provide additional information for advanced readers, to help you get
deeper into some of the harder concepts.
Roadmap
This book has eight chapters and is divided into three parts that guide you from fun-
damental building blocks to more-advanced and practical applications of functional
programming.
xix
xx ABOUT THIS BOOK
Part 3, “Enhancing your functional skills,” discusses the practical benefits of using
functional programming to tackle real-world challenges:
■ Chapter 6 reveals the inherent ease with which functional programs can be unit
tested. In addition, it introduces a rigorous, automated testing mode called
property-based testing.
■ Chapter 7 takes a look at JavaScript’s memory model, which is used to support
the evaluation of functions. This chapter also discusses techniques that help
optimize the execution time of functional JavaScript applications.
■ Chapter 8 introduces some of the main challenges JavaScript developers face
on a day-to-day basis when dealing with event-driven and asynchronous behav-
ior. It discusses how functional programming can provide elegant solutions to
reduce the complexity of existing imperative solutions with a related paradigm
known as reactive programming, implemented using RxJS.
Typographical conventions
The following conventions are used throughout the book:
■ Italic typeface is used to reference important terms.
■ Courier typeface is used to denote code listings, as well as elements and attri-
butes, methods names, classes, functions, and other programming artifacts.
■ Code annotations accompany some of the source code listings, highlighting
important concepts.
xxii ABOUT THIS BOOK
Author Online
Purchase of Functional Programming in JavaScript includes free access to a private web
forum run by Manning Publications where you can make comments about the book,
ask technical questions, and receive help from the author and from other users. To
access the forum and subscribe to it, point your web browser to https://www.manning
.com/books/functional-programming-in-javascript. This page provides information
on how to get on the forum once you are registered, what kind of help is available,
and the rules of conduct on the forum.
Manning’s commitment to our readers is to provide a venue where a meaningful
dialog between individual readers and between readers and the author can take place.
It is not a commitment to any specific amount of participation on the part of the
author, whose contribution to Author Online remains voluntary (and unpaid). We
suggest you try asking the author some challenging questions lest his interest stray!
The Author Online forum and the archives of previous discussions will be accessible
from the publisher’s website as long as the book is in print.
Part 1
Think functionally
I t’s highly probable that most of your experience building professional appli-
cations has been with an object-oriented language. You may have heard or read
about functional programming in other books, blogs, forums, and magazine
articles, but you’ve probably never written any functional code. Don’t worry; this
is to be expected. I’ve done most of my development in an object-oriented envi-
ronment as well. Writing functional code isn’t difficult, but learning to think
functionally and letting go of old habits is. The primary goal of part 1 of this
book is to lay the foundation for and prepare your mind to embrace the func-
tional techniques discussed in parts 2 and 3.
Chapter 1 discusses what functional programming is and the mindset you
need to embrace it; it also introduces some of the most important techniques
based on pure functions, immutability, side effects, and referential transparency.
These form the backbone of all functional code and will help you transition into
functional more easily. Also, these will be the guiding principles that set the stage
for many of the design decisions we make in the following chapters.
Chapter 2 provides a first view of JavaScript as a functional language. Because
it’s so ubiquitous and mainstream, it’s an ideal language with which to teach func-
tional programming. If you aren’t a strong JavaScript developer, this chapter will
bring you up to speed with everything you need to know to understand functional
JavaScript, such as higher-order functions, closures, and scoping rules.
Becoming functional
If you’re reading this book, chances are you’re a JavaScript developer with a work-
ing knowledge of object-oriented or structured design, and you’re curious about
functional programming. Perhaps you’ve tried to learn it before and haven’t been
able to apply it successfully at work or on your personal projects. In either case,
your main goal is to advance your development skills and improve the quality of
your code. This book can help you accomplish that.
3
Another Random Scribd Document
with Unrelated Content
1st. All specimens examined (including Hoy’s type of N. kirtlandi) are
young birds, as is unmistakably apparent from the texture of their
plumage.
2d. All specimens examined of the N. acadica are adults. I have seen
no description of the young.
3d. The geographical distribution, the size and proportions, the
pattern of coloration (except that of the head and body, which in all
Owls is more or less different in the young and adult stages), and
the shades of colors on the general upper plumage, are the same in
both. The white “scalloping” on the outer web of the alula, the
number of white spots on the primaries, and the precise number and
position of the white bars on the tail, are features common to the
two.
4th. The most extreme example of albifrons has the facial circle
uniform brown, like the neck, has no spots on the forehead, and the
face is entirely uniform dark brown; but,
5th. Three out of the four specimens in the collection have the facial
circle composed of white and brown streaks (adult feathers),
precisely as in acadica, and the forehead similarly streaked (with
adult feathers). Two of them have new feathers appearing upon the
sides of the breast (beneath the brown patch), as well as upon the
face; these new feathers are, in the most minute respects, like the
common (adult) dress of N. acadica.
The above facts point conclusively to the identity of the Nyctale
“albifrons” and N. acadica. This species is easily distinguishable from
the N. tengmalmi, which belongs to both continents, though the
North American and European specimens are readily separable, and
therefore should be recognized as geographical races.
Since the above was published in the American Naturalist for May,
1872, Dr. J. W. Velie, of Chicago, writing under date of November 20,
1872, furnishes the following proof of the identity of N. “albifrons”
and N. acadica: “In 1868, I kept a fine specimen of “Nyctale
albifrons” until it moulted and became a fine specimen of Nyctale
acadica. I had, until the fire, all the notes about this interesting little
species, and photographs in the different stages of moulting.”
Habits. The Little Acadian or Saw-Whet Owl, as this bird is more
generally denominated, appears to have a widespread distribution
over temperate North America. It is not known to be anywhere very
abundant, though its nocturnal and secluded habits tend to prevent
any intimate acquaintance either with its habits or its numbers in
any particular locality. It is rarely found in the daytime out of its
hiding-places. It was not met with by Richardson in the fur regions,
yet it is generally supposed to be a somewhat northern species,
occurring only in winter south of Pennsylvania, but for this
impression there does not seem to be any assignable reason or any
confirmatory evidence. It has been said to breed near Cleveland,
Ohio, and its nest and eggs to have been secured. The taking of
Kirtland’s Owl, which is now known to be the immature bird of this
species, near that city, as well as in Racine, and at Hamilton,
Canada, is also suggestive that this Owl may breed in those
localities.
Dr. Townsend is said to have found this Owl in Oregon, Dr. Gambel
met with it in California, Mr. Audubon has taken it both in Kentucky
and in Louisiana, Mr. Wilson met with it in New Jersey, Mr. McCulloch
in Nova Scotia, and Dr. Hoy in Wisconsin. Dr. Newberry met with this
bird in Oregon, but saw none in California. Dr. Suckley obtained it at
the Dalles, on the north side of the Columbia, in December. This was
several miles from the timbered region, and the bird was supposed
to be living in the basaltic cliffs of the vicinity. Dr. Cooper found one
at Vancouver in February. It was dead, and had apparently died of
starvation. Professor Snow speaks of it as rare in Kansas. Mr.
Boardman and Professor Verrill both give it as resident and as
common in Maine. It is rather occasional and rare in Eastern
Massachusetts, and Mr. Allen did not find it common near
Springfield. On one occasion I found one of these birds in April, at
Nahant. It was apparently migrating, and had sought shelter in the
rocky cliffs of that peninsula. It was greatly bewildered by the light,
and was several times almost on the point of being captured by
hand.
This Owl is not unfrequently kept in confinement. It seems easily
reconciled to captivity, becomes quite tame, suffers itself to be
handled by strangers without resenting the familiarity, but is greatly
excited at the sight of mice or rats. Captain Bland had one of these
birds in captivity at Halifax, which he put into the same room with a
rat. The bird immediately attacked and killed the rat, but died soon
after of exhaustion.
The notes of this Owl, during the breeding-season, are said to
resemble the noise made by the filing of a saw, and it is known in
certain localities as the Saw-Whet. Mr. Audubon, on one occasion,
hearing these notes in a forest, and unaware of their source,
imagined he was in the vicinity of a saw-mill.
According to Mr. Audubon, this Owl breeds in hollow trees, or in the
deserted nests of other birds; and lays from four to six glossy-white
eggs, which are almost spherical. He states, also, that he found near
Natchez a nest in the broken stump of a small decayed tree not
more than four feet high. He also mentions the occasional
occurrence of one of these Owls in the midst of one of our crowded
cities. One of them was thus taken in Cincinnati, where it was found
resting on the edge of a child’s cradle. Mr. McCulloch, quoted by
Audubon, gives an interesting account of the notes and the
ventriloquial powers of this bird. On one occasion he heard what
seemed to him to be the faint notes of a distant bell. Upon
approaching the place from which these sounds proceeded, they
appeared at one time to be in front of him, then behind him, now on
his right hand, now on his left, again at a great distance, and then
close behind him. At last he discovered the bird at the entrance of a
small hole in a birch-tree, where it was calling to its mate. As he
stood at the foot of the tree, in full sight of the bird, he observed the
singular power it possessed of altering its voice, making it seem near
or remote,—a faculty which he had never noticed in any other bird.
An egg given me by Mr. Rufus E. Winslow as one of this bird, and
figured in the North American Oölogy, was undoubtedly that of a
Woodpecker. It is of a crystalline whiteness, nearly spherical, and
measures 1.13 inches in length by .87 of an inch in breadth.
A well-identified egg in the collection of the Smithsonian Institution,
taken by Mr. R. Christ at Nazareth, Penn., (No. 14,538, S. I.,)
measures .95 of an inch by .88. The two ends are exactly similar or
symmetrical. The egg is white, and is marked as having been
collected April 25, 1867.
Scops, Savigny, 1809. (Type, Strix scops, L. = Scops zorca (Gm.) Swains.)
Ephialitis, Keys. & Bl. 1840, nec Schrank, 1802.
Megascops, Kaup, 1848. (Type, Strix asio, L.)
Gen. Char. Size small, the head provided with ear-tufts. Bill light-colored; iris
yellow. Three to four outer quills with inner webs sinuated. Wings long (more than
twice the length of the tail, which is short and slightly rounded); second to fifth
quills longest. Toes naked, or only scantily feathered. Ear-conch small and simple.
Plumage exceedingly variegated, the colors different shades of brown, with rufous,
black, and white, in fine mottlings and pencillings; feathers above and below
usually with blackish shaft-streaks, those beneath usually with five transverse
bars; primaries spotted with whitish, and outer webs of the lower row of scapulars
the same edged terminally with black. Tail obscurely banded.
½
Scops asio.
Noctua aurita minor, Catesby, Carol. I, 1754, 7, pl. vii. Asio scops carolinensis,
Briss. Orn. I, 1760, 497. Strix asio, Linn. Syst. Nat. 1758, 92.—Gmel. S. N. 1789,
287.—Lath. Ind. Orn. 1790, 54.—Ib. Syn. I, 123.—Ib. Supp. I, 42; Gen. Hist. I,
314.—Daud. Tr. Orn. II, 1800, 216.—Shaw, Zoöl. VII, 1809, 229.—Temm. Pl. Col.
80.—Wils. Am. Orn. 1808, pl. xlii, f. 1.—Jard. (ed. Wils.) Orn. I, 1831, 307.—
Bonap. Ann. N. Y. Lyc. II, 36.—Ib. Isis, 1832, 1139.—Audubon, Birds N. A. 1831,
pl. xcvii.—Ib. Orn. Biog. I, 486.—Brewer (ed. Wils.) Orn. 1852, p. 687.—Hobs.
Nat. 1855, 169. Bubo asio, Vieill. Ois. Am., Sept., 1807, 53, pl. xxi.—Giraud,
Birds Long Island, 1844, 28.—Max. Cab. J. VI, 1858, 23. Otus asio, Stephens,
Zoöl. XIII, pt. ii, 1815, 57. Scops asio, Bonap. List, 1838, 6.—Less. Tr. Orn. 107.
—Cass. Birds Cal. & Tex. 1854, 179.—Ib. Birds N. Am. 1858, 51.—Kaup, Monog.
Strig. Cont. Orn. 1852, 112.—Strickl. Orn. Syn. I, 1855, 199.—Heerm. P. R.
Rept. II, 1855, 35.—Coop. & Suckl. P. R. Rept. 155.—Maynard, Birds Eastern
Mass., 1870, 131.—Coues, Key, 1872, 202.—Gray, Hand List, I, 1869, 46.
Ephialtes asio, Gray, Gen. B. fol. 1844, sp. 9.—Ib. List Birds Brit. Mus. 1844, p.
96.—Woodh. 1853, 62. Strix nævia, Gmel. S. N. 1789, 289.—Lath. Ind. Orn.
1790, p. 55.—Ib. Syn. I, 126; Gen. Hist. I, 321.—Daud. Tr. Orn. II, 1800, 217.—
Shaw, Zoöl. VII, 1809, 230.—Wils. Am. Orn. 1808, pl. xix, f. 1. Asio nævia, Less.
Man. Orn. I, 1828, 117. Otus nævius, Cuv. Reg. An. (ed. 2), I, 1829, 341.
Surnia nævia, James. (ed. Wils.), Orn., 1831, I, 96 & 99.
a. Normal plumage.
b. Rufescent plumage.
Adult. General pattern of the preceding; but the grayish tints replaced by
lateritious-rufous, very fine and bright, with a slight vinaceous cast: this is
uniform, and shows no trace of the transverse dark mottling; there are, however,
black shaft-lines to the feathers (these most conspicuous on the head above, and
scapulars, and narrower and more sharply defined than in the gray plumage). The
inner webs of the ear-tufts, outer webs of scapulars, and lower secondary and
middle wing-coverts, are white, as in the gray plumage; those of the scapulars are
also bordered with black. The secondaries, primaries, and tail are less bright
rufous than the other portions, the markings as in the gray plumage, only the tints
being different. The upper eyelid, and, in fact, all round the eye, fine light rufous;
cheeks and ear-coverts paler, scarcely variegated; black facial circle rather
narrower than in the gray plumage. Lower parts without the transverse bars of the
gray plumage, but in their place an irregular clouding of fine light red, like the
back; the lower parts medially (very broadly) immaculate snowy-white; most of
the feathers having the red spotting show black shaft-stripes, but the pectoral
spots are not near so large or conspicuous as in the gray bird. Tibiæ fine pale
ochraceous-rufous; tarsi the same posteriorly, in front white with cuneate specks
of rufous; lower tail-coverts each with a medial transversely cordate spot of dilute
rufous, the shaft black. Lining of the wing with numerous rufous spots.
♂ (12,045, Washington, D. C., January). Wing, 6.30; tail, 3.00.
♀ (22,512, Maryland; R. G. Campbell). Wing, 6.70; tail, 3.50.
Young (29,792, Peoria, Illinois; Ferd. Bischoff). Wings and tail as in adult;
markings on head and body as in the young gray bird, but white bars more
reddish, and dark ones more brown.
Hab. Temperate North America, from the South Atlantic States to Oregon, and
from the northern United States to Texas. Replaced in the southern Middle
Province and Southern California by var. maccalli, in Florida by var. floridana, and
on the northwestern coast region by var. kennicotti.
Localities: (?) Cuba (Cabanis, Journ. III, 465).
Scops asio.
Scops asio, Allen, Bull. Mus. Comp. Zoöl. and other citations from Florida.
Char. Similar to var. asio, but much smaller, and the colors deeper. The gray stage
very similar to that of var. asio, but the red phase very appreciably different, in
there being a greater amount of rufous on the lower parts, the breast being nearly
uniformly colored, and the rufous broken elsewhere into transverse broad bars,
connected along the shaft. Wing, 5.50–6.00; tail, 2.75–3.10.
Hab. Florida and Lower Georgia.
This extreme southern form is much smaller than the more northern
ones, being about the same in size as the var. enano (see p. 1374)
of Middle America, and the S. atricapilla, Temm., of Tropical America
generally. The colors, as may be expected, are also darker and
richer.
In the collection of the Smithsonian Institution there are both red
and gray birds from Florida; a red one (No. 5,857, Indian River; Dr.
A. W. Wall) measures, wing, 5.50; tail, 2.70; culmen, .55; tarsus,
1.05; middle toe, .65; ear-tufts, .70. The colors are much darker
than those of typical asio. The rufous of the neck, all around, shows
obsolete darker transverse bars; the black border to the white
scapular spots is restricted to the tip, as in the gray plumage; the
inner webs of the ear-tufts are scarcely paler than the outer; the
neck and face are deeper rufous, while the rufous of the lower parts
is more general, and more in transverse rays; tibiæ and tarsi plain
rufous; the middle of the abdomen and the anal region only are pure
white.
Scops maccalli, Cass. Birds Cal. & Tex. p. 180, 1850; Birds N. Am. 1858, 52.—
Strickl. Orn. Syn. I, 200, 1865.—Coues, Prod. Orn. Ariz., p. 13, 1869.—Scl. &
Salv. P. Z. S., 1868, 57 (= trichopsis, Wagl. Isis, 1832, 276! see remarks
below).—Baird, Mex. Bound. II, 4, pl. i.—Gray, Hand List, I, 47, 1869. Scops
asio, var. maccalli (Ridgway) Coues, Key, 1872, 203. Ephialtes choliba (not of
Vieillot!), Lawr. Ann. N. Y. Lyc. VI, 1853, p. 4.
Char. Adult (9,147, Camp 118, New Mexico, February 10, 1854; Kennerly and
Möllhausen). Above cinereous, the ashy appearance being caused by a minute
transverse mottling of blackish and pale ashy, on a deeper ash ground; each
feather with a distinct medial stripe of black, these broadest on the forehead;
outer webs of only a few scapulars white, these not bordered with black; outer
webs of two or three lower middle and secondary coverts white. Secondaries with
about seven transverse, mottled pale bands; primaries with about eight transverse
series of white spots; tail with about eight narrow pale bands.
Ear-coverts, cheeks, throat, neck, and jugulum finely and uniformly barred
transversely with dusky and grayish-white; the facial circle interrupted across the
throat, where in its place is a series of longitudinal black dashes.
Lower parts grayish-white, with numerous, very narrow transverse bars of dusky,
rather more distant from each other than those of the neck, etc.; each feather
with a medial narrow stripe of black, those on the breast forming conspicuous
spots; tibiæ and tarsi dull soiled white, with numerous spots of dark brown; lower
tail-coverts immaculate. Wing-formula, 3=4–2, 5, 6, 7, 8–1–9. Wing, 6.50; tail,
3.30; culmen, .55; tarsus, 1.15; middle toe, .70; ear-tufts, .85.
(A specimen from California (Stockton, E. S. Holden), kindly sent by Mr. Lawrence
for examination, differs from the preceding in rather more brown ground-color
above; the black shaft-streaks more obscure. In other respects as regards
plumage it is the same, and is typical maccalli. The size is less, it measuring, wing,
6.20; tail, 3.10.)
Young (first full, but incomplete plumage; 16,932, Cape St. Lucas, Lower
California). Secondaries, primaries, and tail as in the gray adult. Rest of the
plumage transversely barred with grayish-white and dusky, the latter
predominating on the upper parts; eyebrows and lores white; rings finely
transversely mottled with white, this forming spots on the lower feathers; tibiæ
and tarsi with numerous transverse dusky bars. Wing, 5.40; tail, 2.65; tarsi, 1.00;
middle toe, .63. No. 16,933 (same locality, etc.) is similar, but smaller, measuring,
5.00, 2.00, 1.00, and .60.
Hab. Southern Middle Province of United States; Lower and Southern California.
Localities. (?) Oaxaca (Scl. 1858, 296); (?) Guatemala (Scl. Ibis, I, 220); (?) Texas
(Dresser, Ibis, 1856, 330).
Scops kennicotti, Elliot, Pr. Ac. Nat. Sc. Phil. 1867, p. 69; Illust. Am. Birds, pl. xi.—
Baird, Trans. Chicago Acad. Sc. I, ii, 311, pl. xxvii, 1869.—Dall & Bannister, Tr.
Chic. Ac. I, 1869, 273.—Gray, Hand List, I, 47, 1869.—Elliot, Illust. Birds Am. I,
xxvii.—Finsch, Abh. Nat. III, 28.—Scops asio, var. kennicotti, (Ridgway) Coues,
Key, 1872, 203. ? Scops asio, Coop. & Suck. P. R. R. Rept. XII, ii, 155, 1860 (all
citations from northwest coast).
Sp. Char. Adult (♂, 59,847, Sitka, Alaska, March, 1866; Ferd. Bischoff. Elliott’s
type). Above umber-brown, with a reddish cast; feathers confusedly mottled
transversely with dusky, and showing rounded spots of rufous, most conspicuous
on the nape; each feather with a conspicuous medial broad ragged stripe of black,
these stripes most conspicuous on the forehead and scapulars; outer webs of
scapulars light rufous, bordered terminally with black. Wings of a more grayish
cast than the back, but similarly variegated; lower feathers of the middle and
secondary wing-coverts, each with a large oval pale rufous spot, covering most of
the lower web. Secondaries crossed by six narrow obscure bands of pale rufous;
primaries with seven somewhat rounded, quadrate spots of the same on the outer
webs, forming as many transverse series; each light spot with a central dusky
mottling. Tail more finely and confusedly mottled than the wings; the bands,
though present, are so obsolete as to be scarcely traceable, and so irregular or
badly defined as to be of uncertain number. The ear-tufts are black and rusty, the
former along the shafts, and in transverse spots; on the outer webs the black
predominates, on the inner the rusty.
The lores and basal half of the frontal bristles are white, the terminal half abruptly
black; eyebrows about equally blackish and paler, the former bordering the
feathers; eye surrounded by dark snuff-brown; cheeks and ear-coverts pale rusty,
transversely barred with deeper rusty; facial circle not well defined, black. Chin
and lores only white.
Ground-color of the lower parts dilute-rusty, becoming white on the flanks; each
feather of the throat, jugulum, breast, sides, and flanks with a broad medial stripe
of black, this throwing off very narrow, rather distant, bars to the edge; the spaces
between these bars are alternately paler and deeper dilute-rusty; the black marks
are broadest on the sides of the breast, where they have an external deep rusty
suffusion; the abdomen medially, and the anal region, are scarcely maculate rusty-
white; the lower tail-coverts have each a central cuneate longitudinal stripe of
black. Tibiæ, tarsi, and lining of the wing, plain deep rusty. Wing-formula, 3=4, 5–
2, 6–1=9. Wing, 7.40; tail, 4.00; culmen, .65; tarsus, 1.50; middle toe, .80.
No. 59,068 (Idaho; Dr. Whitehead) is considerably darker than the type, the
ground-color above approaching to snuff-brown; it differs, however, in no other
respect, as regards coloration; the size, however (as would be expected), is
considerably smaller, measuring as follows: Wing, 6.80; tail, 3.50; culmen, .60;
tarsus, 1.20; middle toe, .80. Wing-formula the same as in type.
Hab. Northwestern coast of North America, from Columbia River, northward; Idaho
(Dr. Whitehead).
Lower parts, in general, white; each feather with a black shaft-stripe, this throwing
off bars in pairs, across the feather; the medial stripes are very broad, forming
longitudinal spots on the breast, and have here an external rufous suffusion; lower
tail-coverts very sparsely marked. Tibiæ and tarsi white, with very sparse
transverse dusky spots. Lining of the wing plain yellowish-white; bars on under
surface of primaries very obsolete, except basally. Wing-formula, 3=4; 5, 2–6;
1=8. Wing, 5.40; tail, 2.45; culmen, .35; tarsus, .87; middle toe, .55.
Young (first full, but imperfect plumage: ♂, 24,172, Fort Crook, North California,
August 23, 1860; John Feilner). Wings and tail as in the adult (last pale band of
latter apparently terminal). Whole head and body with numerous, about equal,
transverse bands of dusky and grayish-white; the two colors about equal, but on
lower parts both are much wider and more distinct than above the white gradually
increasing posteriorly. Breast and outer webs of scapulars with a rusty tinge, the
latter scarcely variegated. Eyebrow white, feathers bordered with dusky; eye-circle
and ear-coverts bright rusty-rufous; lores much tinged with the same. No facial
circle. Wing, 5.50; tail, 2.70.
Hab. Guatemala and central Mexico, northward (along Sierra Nevada) to Fort
Crook; California (breeding).
Gen. Char. Size varying from medium to very large; head with or without ear-tufts.
Bill black; iris yellow. Two to four outer quills with their inner webs emarginated.
Third or fourth quill longest. Bill very robust, the lower mandible nearly truncated
and with a deep notch near the end; cere gradually ascending basally (not arched)
or nearly straight, not equal to the culmen. Tail short, a little more than half the
wing, slightly rounded. Ear-conch small, simple, without operculum; the two ears
symmetrical.
Subgenera.
Nyctea, Stephens, Cont. Shaw’s Zoöl. XIII, 62, 1826. (Type Strix nyctea, Linn. N.
Scandiaca, Linn.).
Asio bubo virginianus, Briss. Orn. I, 484, 17, 1760. Strix virginiana, Gmel. Syst. Nat.
I, 287, 1788.—Lath. Ind. Orn. p. 52; Syn. I, 119; Supp. I, 40; Gen. Hist. I, 304.
—Daud. Tr. Orn. II, 210, pl. xiii.—Wils. Am. Orn. pl. l, f. 1.—Bonap. Ann. Lyc.
N. Y. II, 37 and 435; Isis, 1832, p. 1139.—Aud. Birds Am. pl. lxi, 1831; Orn.
Biog. I, 313.—Thomps. Nat. Hist. Vermont, pl. lxv.—Peab. Birds Mass. p. 87. Bubo
virginianus, Bonap. List, p. 6, 1838; Consp. Av. p. 48.—Jard. (Wils.) Am. Orn. II,
p. 257.—De Kay, Zoöl. N. Y. II, 24, pl. x, f. 2.—Nutt. Man. Orn. p. 124.—Max.
Cab. Jour. 1853, VI, 23.—Kaup, Tr. Zoöl. Soc. IV, 1859, 241.—Coues, Key, 1872,
202. Bubo virginianus atlanticus, Cassin, Birds of Cal. & Tex. I, 178, 1854.—
Birds N. Am. 1858, 49 (under B. virginianus). Otus virginianus, Steph. Zoöl.
XIII, ii, 57, 1836. Ulula virginiana, James. (Wils.), Am. Orn. I, 100, 1831. Strix
virginiana, α, Lath. Gen. Hist. I, 306, 1821. Strix bubo, δ, Lath. Ind. Orn. p. 52,
1790.—Shaw, Zoöl. VII, 215. Strix maximus, Bart. Trav. Carol. p. 285, 1792.
Bubo ludovicianus, Daud. Tr. Orn. II, 210, 1800. Bubo pinicola, Vieill. Ois. Am.
Sept. pl. xix, 1807; Enc. Méth. p. 1282.
6886 ½ ½
Bubo virginianus.
Sp. Char. Adult ♂ (12,057, Philadelphia; C. Drexler). Bases of all the feathers
yellowish-rufous, this partially exposed on the head above and nape, along the
scapulars, on the rump, and sides of the breast. On the upper surface this is
overlaid by a rather coarse transverse mottling of brownish-black upon a white
ground, the former rather predominating, particularly on the head and neck,
where it forms broad ragged longitudinal stripes (almost obliterating the
transverse bars), becoming prevalent, or blended, anteriorly. The lower feathers of
the scapulars, and some of the lower feathers of the middle and secondary wing-
coverts, with inconspicuous transverse spots of white. On the secondaries the
mottling is finer, giving a grayish aspect, and crossed with eight sharply defined,
but inconspicuous, bands of mottled dusky; primary coverts with the ground-color
very dark, and crossed with three or four bands of plain blackish, the last terminal,
though fainter than the rest; ground-color of the primaries more yellowish, the
mottling more delicate; they are crossed by nine transverse series of quadrate
dusky spots. The ground-color of the tail is pale ochraceous (transversely mottled
with dusky), becoming white at the tip, crossed by seven bands of mottled
blackish, these about equalling the light bands in width; on the middle feathers
the bands are broken and confused, running obliquely, or, in places, longitudinally.
Outer webs of ear-tufts pure black; inner webs almost wholly ochraceous;
eyebrows and lores white, the feathers with black shafts; face dingy rufous; eye
very narrowly encircled with whitish; a crescent of black bordering the upper
eyelid, and confluent with the black of the ear-tufts. Facial circle continuous black,
except across the foreneck; chin, throat, and jugulum pure immaculate white, to
the roots of the feathers. Beneath, white prevails, but the yellowish-rufous is
prevalent on the sides of the breast, and shows as the base color wherever the
feathers are disarranged. The sides of the breast, sides, and flanks have numerous
sharply defined narrow transverse bars of brownish-black; anteriorly these are
finer and more ragged, becoming coalesced so as to form conspicuous, somewhat
longitudinal, black spots. On the lower tail-coverts the bars are distant, though not
less sharply defined. The abdomen medially is scarcely maculate white. Legs and
toes plain ochraceous-white.
6886 ⅓
Bubo virginianus.
Wing-formula, 2, 3–4–1, 5. Wing, 14.50; tail, 8.20; culmen, 1.10; tarsus, 2.00;
middle toe, 2.00.
♀ (12,065, Maryland; R. J. Pollard). General appearance same as the male. Black
blotches on head above and nape less conspicuous, the surface being mottled like
the back, etc.; primary coverts with three well-defined narrow pure black bands;
primaries with only six bands, these broader than in the male; secondaries with
only five bands; tail with but six dark bands, these very much narrower than the
light ones. Tibiæ and tarsi with sparse transverse bars of dusky. Wing-formula, 3,
2, 4–1=5. Wing, 16.00; tail, 9.00; culmen, 1.20; tarsus, 2.20; middle toe, 2.10.
Young. Wings and tail as in adult. Downy plumage of head and body ochraceous,
with detached, rather distant, transverse bars of dusky. (12,062, Washington,
D. C., May 20, 1859; C. Drexler.)
Hab. Eastern North America, south of Labrador; west to the Missouri; south
through Atlantic region of Mexico to Costa Rica; Jamaica (Gosse).
Localities: (?) Oaxaca (Scl. 1859, 390; possibly var. arcticus); Guatemala (Scl. Ibis,
I. 222); Jamaica (Gosse, 23); Texas (Dresser, Ibis, 1865, 330, breeds); Costa Rica
(Lawr. IX, 132).
Specimens from the regions indicated vary but little, the only two
possessing differences of any note being one (58,747,30 ♂) from
Southern Illinois, and one (33,218, San Jose; J. Carmiol) from Costa
Rica. The first differs from all those from the eastern United States
in much deeper and darker shades of color, the rufous predominant
below, the legs and crissum being of quite a deep shade of this
color; the transverse bars beneath are also very broad and pure
black. This specimen is more like Audubon’s figure than any other,
and may possibly represent the peculiar style of the Lower
Mississippi region. The Costa Rica bird is remarkable for the
predominance of the rufous on all parts of the plumage; the legs,
however, are whitish, as in specimens from the Atlantic coast of the
United States. These specimens cannot, however, be considered as
anything else than merely local styles of the virginianus, var.
virginianus.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com