Snippets created by Tao Liu

  • Factory Pattern

    Factory pattern in F#

    57 people like this
    Posted: 9 months ago by Tao Liu

  • Proxy Pattern

    Proxy pattern is a class functioning as an interface to something else.

    37 people like this
    Posted: 9 months ago by Tao Liu

  • Chain of responsibility II

    Unlike the previous chain of responsibility, this version use the pipeline to chain responsibilities.

    79 people like this
    Posted: 8 months ago by Tao Liu

  • WPF / SilverLight Converter II

    version 1 is http://fssnip.net/62. This new version support convert from any existing function to a converter function by using composition and pipeline. The convert function is to make the function signature agree to the IValueConverter interface. You can add new functions in the FunctionLibrary module and reuse the class definition to reduce the coding effort. The first sample is to show how to make the converter pipeline work, the second one is a debugger converter used to debug the data binding problem.

    74 people like this
    Posted: 8 months ago by Tao Liu

  • Command pattern for Redo-Undo II

    This command redo-undo implement group the command under Do/Undo category.

    58 people like this
    Posted: 8 months ago by Tao Liu

  • Template pattern

    Template pattern is a behavior-based pattern. Realized the importance of high order function, this is a way to use high order function. Still keep the type structure to organize my code.

    34 people like this
    Posted: 6 months ago by Tao Liu

  • Make a chain of functions

    Function composition can be done by using >> operator. The snippet at http://fssnip.net/S is a wonderful sample. But that version generates a function which is not easy when you want to debug. This version is to use pipeline (|>) operator.

    26 people like this
    Posted: 5 months ago by Tao Liu

  • WPF Command in F#

    demonstrate how to use object expression to create a WPF/Silverlight command.

    17 people like this
    Posted: 2 months ago by Tao Liu