r/programming • • Feb 17 '16

Stack Overflow: The Architecture - 2016 Edition

http://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/
1.7k Upvotes

461 comments sorted by

View all comments

0

u/[deleted] Feb 17 '16

StackExchange.Redis + Protobuf-net + F# is a fun time for your L1/L2 caching needs.

You will need to explicitly call the implicit operators in StackExchange.Redis though, which is hilarious. This little operator overloader makes it less annoying:

 let inline (!>) (x : ^a) : ^b = ((^a or ^b) : (static member op_Implicit : ^a -> ^b) x)

2

u/marcgravell Feb 17 '16

I take pull requests if there is something I should be doing different to remove this.

1

u/[deleted] Feb 17 '16

Nope, not your fault. The implicit conversion is just fundamentally incompatible with F#, so the only solution (I think) is to provide an explicit conversion function, but F# already exposes that with op_Implicit()

You could just not have implicit conversion to remove the confusion but that would be a breaking change and inconvenient for most consumers.