Snippets tagged operators

  • Perl Style "Regex Matches?" operator

    Perl Style "Regex Matches?" operator

    49 people like this

    Posted: 13 years ago by fholm

  • Type-inference friendly division and multiplication

    F# necessarily forces you to explicitly cast between int and float for operations such as division. This is necessary because implicit conversion would make type inference much harder. However having to cast all the time in your code can be a pain. These operators reduce the overhead to one or at most two characters of code.

    3 people like this

    Posted: 11 years ago by Kit Eason

  • Unmanaged memory search

    Useful for pinvoke stuff where your native API requires that you have a unmanaged buffer containing the data you want to work on. Edit: Changed native calls, removed Marshal.Copy (there is a async corner case but I won't delve into it here) and replaced with pinning.

    5 people like this

    Posted: 10 years ago by David Klein

  • APL mode for F#

    Inspired by @theburningmonk, this snippet defines a couple of extensions and operators that can be used to make F# as short and as obscure as APL. Complete with a 19 character solution of the Euler problem #1!

    7 people like this

    Posted: 8 years ago by Tomas Petricek