← Înapoi la Urmăritori

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 193
  1. “I think I understand functional programming at the micro level, and I have written toy programs, but how do I actually go about writing a complete application, with real data, real error handling, and so on?"

  2. Are you fed up with all the hype about functional programming?

  3. We’re coming into the home stretch now.

  4. Implementing a CE: Adding laziness

    In a previous post, we saw how to avoid unnecessary evaluation of expressions in a workflow until needed.

  5. Implementing a CE: Overloading

    In this post, we’ll take a detour and look at some tricks you can do with methods in a computation expression builder.

  6. Implementing a CE: Delay and Run

    In the last few posts we have covered all the basic methods (Bind, Return, Zero, and Combine) needed to create your own computation expression builder.

  7. Implementing a CE: Combine

    In this post we’re going to look at returning multiple values from a computation expression using the Combine method.

  8. Implementing a CE: Zero and Yield

    Having covered bind and continuations, and the use of wrapper types, we’re finally ready to take on the full set of methods associated with “builder” classes.

  9. More on wrapper types

    In the previous post, we looked at the concept of “wrapper types” and their relation to computation expressions.

  10. In the previous post, we were introduced to the “maybe” workflow, which allowed us to hide the messiness of chaining together option types.

  11. Introducing 'bind'

    In the last post we talked about how we can think of let as a nice syntax for doing continuations behind scenes.

  12. Understanding continuations

    In the previous post we saw how some complex code could be condensed using computation expressions.

  13. Computation expressions: Introduction

    By popular request, it is time to talk about the mysteries of computation expressions, what they are, and how they can be useful in practice (and I will try to avoid using the forbidden m-word).

  14. Designing with types: Conclusion

    In this series, we’ve looked at some of the ways we can use types as part of the design process, including: Breaking large structures down into small “atomic” components.

  15. Designing with types: Non-string types

    In this series we’ve seen a lot of uses of single case discriminated unions to wrap strings.

  16. In a previous post, I talked about avoiding using plain primitive strings for email addresses, zip codes, states, etc.

  17. In this post we will look at making implicit states explicit by using state machines, and then modelling these state machines with union types.

  18. In the last post, we looked at how we could represent a business rule using types.

  19. In this post, we look at a key benefit of F#, which using the type system to “make illegal states unrepresentable” (a phrase borrowed from Yaron Minsky).

  20. At the end of the previous post, we had values for email addresses, zip codes, etc., defined like this: EmailAddress: string; State: string; Zip: string; These are all defined as simple strings.

  21. Designing with types: Introduction

    In this series, we’ll look at some of the ways we can use types as part of the design process.

  22. Getting started with direct porting

    Before we get started on the detailed examples, we’ll go back to basics and do some simple porting of trivial examples.

  23. Porting from C# to F#: Introduction

    NOTE: Before reading this series, I suggest that you read the following series as a prerequisite: “thinking functionally”, “expressions and syntax”, and “understanding F# types”.

  24. Object expressions

    So as we saw in the previous post, implementing interfaces in F# is a bit more awkward than in C#.

  25. Interfaces

    Interfaces are available and fully supported in F#, but there are number of important ways in which their usage differs from what you might be used to in C#.

  26. Inheritance and abstract classes

    This is a follow-on from the previous post on classes.

  27. Classes

    This post and the next will cover the basics of creating and using classes and methods in F#.

  28. In this series, we’ll look at how F# supports object-oriented classes and methods.

  29. Formatted text using printf

    In this post, we’ll take a small detour and look at how to create formatted text.

  30. Units of measure

    As we mentioned earlier in the “why use F#?”

  31. Built-in .NET types

    In this post we’ll take a quick look at how F# handles the standard types that are built into .NET.

  32. Understanding type inference

    Before we finish with types, let’s revisit type inference: the magic that allows the F# compiler to deduce what types are used and where.

  33. Enum types

    The enum type in F# is the same as the enum type in C#.

  34. In this post, we’ll implement a simple stack based calculator (also known as “reverse Polish” style).

  35. Worked example: Roman numerals

    Last time we looked at parsing a command line.

  36. Now that we’ve seen how the match expression works, let’s look at some examples in practice.

  37. Match expressions

    Pattern matching is ubiquitous in F#.

  38. The Option type

    Now let’s look at a particular union type, the Option type.

  39. Discriminated Unions

    Tuples and records are examples of creating new types by “multiplying” existing types together.

  40. Records

    As we noted in the previous post, plain tuples are useful in many cases.

  41. Tuples

    We’re ready for our first extended type – the tuple.

  42. Type abbreviations

    Let’s start with the simplest type definition, a type abbreviation or alias.

  43. Overview of types in F#

    Before we dive into all the specific types, let’s look at the big picture.

  44. Understanding F# types: Introduction

    NOTE: Before reading this series, I suggest that you read the “thinking functionally” and “expressions and syntax” series as a prerequisite.

  45. Exceptions

    Just like other .NET languages, F# supports throwing and catching exceptions.

  46. Control flow expressions

    In this post, we’ll look at the control flow expressions, namely: if-then-else for x in collection (which is the same as foreach in C#) for x = start to end while-do These control flow expressions are no doubt very familiar to you.

  47. Parameter and value naming conventions

    If you are coming to F# from an imperative language such as C#, then you might find a lot of the names shorter and more cryptic than you are used to.

  48. F# syntax: indentation and verbosity

    The syntax for F# is mostly straightforward.

  49. Overview of F# expressions

    In this post we’ll look at the different kinds of expressions that are available in F# and some general tips for using them.

  50. Binding with let, use, and do

    As we’ve have already seen, there are no “variables” in F#.