The previous six kinds of optics can only access or modify values. There is one additional capability an optic may have: being able to create values. Take for example a Result type whose Error case holds a single string value. From that single string we can create a whole Result; this means we can build an _Error optic – a prism in this case – which can both get and create.

Learn the best ways to create amazing images and videos, share your works with the community and be inspired by our community.

Notice how the buildings don’t appear to converge towards the top. They would on a wide-angle lens due to perspective exaggeration.

A very important idea in this framework is that, in contrast to usual getter/setter pairs, an optic can target zero, one, or an unrestricted amount of positions within your data.

Optics provide a language for data access and manipulation. They fit the functional paradigm very well, because their focus on composability – you build more complex optics from a small set of building blocks – and immutability – whenever you apply an operation to a value, a copy is returned, in constrast with mutable approaches. Libraries like Monocle for Scala, with a port to TypeScript, Arrow Optics  for Kotlin, Bow Optics for Swift, Aether for F#, optics and lens for Haskell give an idea of the popularity within these communities.

Learn the best ways to create amazing images and videos, share your works with the community and be inspired by our community.

Getting up close to birds and other wildlife requires a special type of telephoto lens: a super telephoto lens. You may want to combine it with an extender for even further reach.

Telephoto lenses provide an angle of view that is much narrower than human vision. 70-200mm lenses provide the classic telephoto focal range.

When picking a lens, one of the first things you must decide on is the focal length or focal range that you want. This is because the focal length describes the angle of view, i.e., it tells how much of the scene in front of you the lens can capture.

Optics functionalprogramming

A shorter focal length… - Captures more of the scene (= has a wider angle of view) - Makes distant objects appear smaller (= has lower magnification)

Since we have three “levels of amounts” and two possibilities for setting (we are able or not), we get six different kinds of optics, plus an additional one for setting without access. This is where the zoo of names comes into play: almost every square gets a different name – in some cases, the same square receives different names depending on the library.

Ultra-wide-angle lenses exaggerate perspective so distances between objects look bigger. When combined with the wide field of view, it can bring out a sense of space.

For example, when we apply a modification using an optic targeting element of an array (unrestricted amount), such operation is applied to every element in bulk. We also have optics that target optional values (think of a key in a JSON document that may be missing). In any of the three cases, modification can be performed in two ways:

As mentioned above, one of the advantages of optics are their compositionality. You can compose any two optics provided they share some common operation, and the result is the strongest optic that complies with it. Let me unwrap this with an example: say you want to compose an Optional/AffineTraversal (zero or one values, both get and set) with a Getter (exactly one value, only get). The result must be the optic that targets zero or one values (since targeting one value can be downgraded to that case), and only allows getting (since Getter does not provide the setting capability). This means the composition of Optional/AffineTraversal and Getter is a PartialGetter/AffineFold.

As a beginner with optics, though, you can be easily overloaded by a dozen terms. Lenses, prisms, (affine) traversals . . . they all seem similar, but different. But this does not have to be the case! Underlying this zoo of optics, there are an orthogonal set of concepts, which, mixed in the right proportion, give rise to the different optics.

Transducersprogramming

Any focal length above 135mm full-frame equivalent is considered telephoto. However, 70 to 135mm (full-frame equivalent) is considered short or medium telephoto. These are popular for portrait and product photography due to their natural perspective and comfortable working distance for close-up shots.

Learn more about how to make the most of wide-angle lenses in: Exploring Wide Angle Lenses Part 1: Photo Effects of Wide-Angle Lenses 24mm Closeups: 3 Simple Exercises for Mastering Wide-Angle Perspective

Depending on the scene and your intentions, you might not need to go ultra-wide to frame what you want to show perfectly.

Light entering the lens converges (crosses) on its way to the image sensor. This convergence point is known as the optical centre of the lens and has the sharpest focus. The focal length is the distance between this convergence point and the image sensor.

Lenses are classified as wide-angle, standard, or telephoto depending on their focal lengths. Ultra-wide-angle lenses are a subset of wide-angle lenses, whereas medium telephoto and super telephoto lenses are subsets of telephoto lenses.

After all this discussion, we have found ten interesting combinations of operations, each one with a different name. The following diagram describes their relations, with an arrow meaning that a certain optic provides more features than its parent, or conversely, that it can be casted into it.

Due to physics, a lens with a shorter focal length has a wider angle of view, and one with a longer focal length has a narrower angle of view. And that’s how we came to use focal length to describe the angle of view of a lens!

This focal length is measured when the lens is focused to infinity (far into the distance). This is because when the lens is focused to infinity, light rays enter the lens almost parallel. When focused on a nearby subject, they enter the lens at an angle.

Something quite interesting is that, if you can provide a way to get and to build, you are also providing a way to set or modify. For that reason, both Iso and Prism are also in the set/modify part of the hierarchy.

We usually describe a lens by its focal length. What does it refer to and how does it affect your images? Find out in this article.

A longer focal length… - Captures less of the scene (= has a narrower angle of view) - Makes distant objects appear bigger (= has a higher magnification)

Functional lens glasses

The focal length also affects many other aspects of your image, such as perspective and depth of field. To find out more,  see 4 Lens Concepts to Revolutionise Your Photos.

Let’s look at what happens when we shoot at different focal lengths from the same position. Note: For ease of illustration, the angles shown in this article are the horizontal angle of view.

In essence, different kinds of optics provide different operations. Any operation always requires at the very least the optic and the data to which it should be applied. One of the simplest is accessing a value within a record, usually called get or view. Different libraries choose its syntax depending on the best style in their respective languages:

When you look straight ahead with your bare eyes, the field of view in focus is around 50° to 60°. Wide-angle lenses are any lens that gives a field of view wider than that. Ultra-wide-angle lenses are a special kind of wide-angle lens.

Learn more about what you can do with a standard lens in: Standard Lens Techniques: Using the Point of View to Draw the Viewer In 50mm Portraits, My Style: Creating A Picture of a Memory

Please note that SNAPSHOT account based features and services are ONLY available to citizens and/or legal residents of selected countries/regions in South and Southeast Asia.

A standard or “normal” lens gives a perspective that is very close to that of human vision. Most kit lenses are standard zoom lenses. The popular RF50mm f/1.8 STM “nifty fifty” lens is a standard lens on a full-frame camera, whereas the RF28mm f/2.8 STM is a slightly wider standard lens on an APS-C camera.

Image

Ultra-wide-angle lenses take in so much that they are perfect for capturing grand scenes and large objects that are right in front of you, especially in tight spaces where you cannot move further back.

Functionallenses

Also see: Why Is a Super Telephoto Lens Necessary for Sports Photography? What is the difference between a 200mm and 300mm telephoto lens?

Learn composition techniques that leverage on the characteristics of different lenses in: Professional Composition Techniques (3): Making Good Use of Lenses

This adds yet another axis to our previous table, depending on whether when accessing you are guaranteed to have a value or not. Following with our example of Result, _Error holds an optional value, because a Result may also be _Success, and, in that case, there is no error value to obtain.

Whereas you apply modifications irrespectively from the amount of targets, the access operations must be aware of this fact. For that reason, optics frameworks usually provide three levels of “getters”:

You need a very long focal length to capture a detailed close-up picture of the moon without cropping. The image above was captured at 1600mm using an 800mm lens and a 2x extender.

It is always safe to treat an optic in a less restricted way. For example, if your optic targets exactly one value, you can also use preview or toList over it. As we will see in a second, this is important for optics composition.

Image

Image

At 16mm, we can capture the entire façade of the fire station as well as the road and the hedge in the foreground. As the focal length increases, details appear bigger in the frame while more of the foreground and the building is cropped out. 200mm gives us a good close-up of the building name and the crests below it.

Optics are becoming increasingly popular in functional programming circles, due to its conciseness and how well it works with immutable data.