Recent snippets

  • Counting Evens and Odds via Z3

    Counting Evens and Odds via Z3.

    0 people like this

    Posted: 2 days ago by NIck Palladinos

  • Universal Mutator

    Defines a generic `mutate : 'T -> 'T` function that structurally mutates every value in the object graph, without performing new allocations. Needless to say, this is intended for educational purposes only.

    2 people like this

    Posted: 3 days ago by Eirik Tsarpalis

  • F# SRTP of Type Classes from OO Perspective

    Similar to http://fssnip.net/7Tr, this implementation translates the Scala from https://functional.works-hub.com/blog/Type-classes-from-OO-perspective but uses statically resolved type parameters to show how something similar could be done with computation expression instances. It's really too bad you have to pass an instance of the implementation. It would be nice to be able to specify a module or class with a static member.

    1 people like this

    Posted: 8 days ago by Ryan Riley

  • F# version of Type Classes from OO Perspective

    This is the F# translation of the Scala program written for https://functional.works-hub.com/blog/Type-classes-from-OO-perspective. F# doesn't have implicits, so type classes don't work. However, it's interesting to see just how close you can come by passing an instance of the implementation. By flipping the parameters, you can use partial application to create type-specific functions. Here, we follow the use of the interface, but we could also use statically resolved type parameters to structurally infer different implementations.

    1 people like this

    Posted: 8 days ago by Ryan Riley

  • Staged Trampoline

    Staged Trampoline.

    1 people like this

    Posted: 9 days ago by NIck Palladinos

  • yin-yang puzzle in F#

    yin-yang puzzle, based on https://groups.google.com/forum/#!msg/comp.lang.scheme/Fysq_Wplxsw/awxEZ_uxW20J

    0 people like this

    Posted: 10 days ago by NIck Palladinos

Popular snippets

Snippets by tags

list (49) http (14) lists (13) regex (12) dsl (22) algorithms (25) async (92) sequence (29) lazy (18) staging (17) kata (17) collections (16) mailboxprocessor (25) game (30) array (18) tryfsharp (48) wpf (18) xml (12) monad (20) quotations (17)

View all...

Database contains 2132 snippets out of which 1471 is public.