79378700

Date: 2025-01-22 17:32:41
Score: 1.5
Natty:
Report link

F# 9 now allows returning bool from partial active patterns so here's another way of writing the same thing:

let (|GET|_|) x = x = HttpMethod.Get

let (|POST|_|) x = x = HttpMethod.Post

let m method =
    match request.Method with
    | GET -> "GET"
    | POST -> "POST"
    | _ -> ""

https://learn.microsoft.com/en-us/dotnet/fsharp/whats-new/fsharp-9#partial-active-patterns-can-return-bool-instead-of-unit-option

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: jrequejo