concept primitive in category c#

This is an excerpt from Manning's book Unity in Action: Multiplatform game development in C# with Unity 5.
Much of the work when adding visual polish to the level is done in external 3D art applications like Blender. Because of this, you may want to have the whitebox geometry in your art tool to refer to. By default there’s no export option for primitives laid out within Unity. But third-party scripts are available that add this functionality to the editor. Most such scripts allow you to select the geometry in the scene and then hit an Export button (chapter 1 mentioned that scripts can customize the editor).

This is an excerpt from Manning's book Real-World Functional Programming with Examples in F# and C#.
Declarative programming style gives us another great technique for writing parallel programs. You know that the code written using the declarative style is composed using primitives. In LINQ, these primitives are query operators such as where and select. In the declarative style, we can easily replace the implementation of these primitives and that’s exactly what PLINQ does: it allows us to replace standard query operators with query operators that run in parallel.
A second example of composable design is the F# library for working with lists. We can use this library as inspiration to teach us how to write good functional libraries. This time the primitives involved are the operations to create lists from scratch, and those we can apply to existing lists such as List.filter, List.length, and so on. We can use primitives individually, but more often we’ve composed them into a single list-processing unit using the pipelining operator (|>). This composable design is also an essential element of the declarative style. We can describe what we want to achieve by composing primitives or derived components that we built earlier.
Our main example in this chapter will be a library for creating animations. We’ll use a bottom-up approach when describing the library. This means that for most of the chapter we’ll be talking about very simple things. We’ll look at a couple of primitives for representing values that change with the time and a simple representation of drawings. The beauty of a composable library is that each piece is easy to build, understand, and test. The power is demonstrated when we start putting these building blocks together. In this case we’ll not only combine primitives from the same domain, but we’ll bring two domains together: a drawing that varies over time is practically the definition of an animation. This is a bit like using LINQ to XML, which is an XML API designed to work well with LINQ to Objects. When libraries can be combined in a natural way, it can lead to readable and flexible code.
In listing 15.17, we created a translate primitive that works with animations by lifting the Drawings.translate function. Now we need to do the same thing for the other drawing primitives, circle and compose. Listing 15.18 shows the F# declarations for a composition operator and a primitive that creates an animated circle. We’ve included the C# version of composition (this time as an extension method) to demonstrate how to use lifting in C#. The C# implementation of the other lifted operations is essentially the same, so it isn’t included in the listing.
Using lifting in F# is quite easy thanks to its advanced type inference. We created the translate primitive earlier, so in this listing we add the circle function and a custom operator -- ❶ for composing animations. Both have two arguments, so we can use the Behavior.lift2 function to take a function that works with drawings and turn it into a variant that works with animations. As you can see from the inferred type signature ❷, the resulting function (or an operator) takes two behaviors as arguments and returns a behavior (more specifically, the type Behavior<Drawing>, which represents an animation). The circle function now takes both the brush and the size as behaviors, so we can create circles that change color and size over time.
The next two primitives let us limit the dates for which a contract is active ❸. We implemented them by creating a function that tests whether the given date matches the condition of the primitive. When the test succeeds, it returns all underlying trades using the yield! primitive; otherwise it returns an empty sequence. The final primitive can be used to change whether a contract is a sale or a purchase ❹. We iterate over all the underlying trades of a contract, changing positive amounts to negative, and vice versa.