Is there a way to nest calls to active patterns?
Something like this:
type Fnord =
| Foo of int
let (|IsThree|IsNotThree|) x =
match x with
| x when x = 3 -> IsThree
| _ -> IsNotThree
let q n =
match n with
| Foo x ->
match x with
| IsThree -> true
| IsNotThree -> false
// Is there a more ideomatic way to write the previous
// 5 lines? Something like:
// match n with
// | IsThree(Foo x) -> true
// | IsNotThree(Foo x) -> false
let r = q (Foo 3) // want this to be false
let s = q (Foo 4) // want this to be true
Or is the match followed by another match the preferred way to go?
Google-supported calling allows you to make audio calls to mobile, landline, and business phone numbers at no additional cost. Important: As of mid-December 2020, if you're in the UK, you're no longer able to make Google-supported calls on your speaker or display. You can still make audio or video calls through Duo.
With carrier calling on speakers and displays, you can use your phone's mobile or landline service plan to call friends, family, and businesses as your plan allows. Calls you make are billed according to your plan.
Send a message to everyone in your home with the broadcast feature on Google Home and Nest speakers and displays.
Google-supported calls: This is the simplest way to make voice calls on your Google Nest devices. Simply say, "Hey, Google, call [name in your Google Contacts]." You can make free calls to US and Canadian mobile, landline and business phone numbers.
It works. You just have the patterns backwards.
type Fnord =
| Foo of int
let (|IsThree|IsNotThree|) x =
match x with
| x when x = 3 -> IsThree
| _ -> IsNotThree
let q n =
match n with
| Foo (IsThree x) -> true
| Foo (IsNotThree x) -> false
let r = q (Foo 3) // want this to be true
let s = q (Foo 4) // want this to be false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With