Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6477001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:53:40+00:00 2026-05-25T06:53:40+00:00

For an inline function one could create a constraint like: let inline implicit arg

  • 0

For an inline function one could create a constraint like:

let inline implicit arg =
  ( ^a : (static member op_Implicit : ^b -> ^a) arg)

requiring the given operator or member on the arguments. Is there a way to match based on somthing similar?

I want to create an active pattern where any argument that’s passed to the method that matches the constraint of an inlined function as the above triggers that function and everything else ends as part of some error management.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:53:41+00:00Added an answer on May 25, 2026 at 6:53 am

    It looks like you can write inline active patterns too. I haven’t used this before, but I tried it now and it seems to work just fine. The Test pattern below can be used with any object that implements Test method that returns option< ^R >:

    let inline (|Test|_|) (a:^T) : option< ^R > =
      (^T : (member Test : unit -> option< ^R >) a)
    

    Now you can define some objects that define Test method and match them using the pattern:

    type A() =
      member x.Test() = Some(10)
    
    match new A() with
    | Test(n) -> printfn "%d" n
    | _ -> printfn "failed"
    

    This looks like a very interesting technique, because pattern matching is now a part of the object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to pass one variable to a jQuery function inline (i.e.: using
I would like to know if it's possible to call a inline function with
I have an inline member function defined under class MyClass int MyClass::myInlineFunction(); This function
When should I inline a member function and when should I use member initializers?
Assume I have a function template like this: template<class T> inline void doStuff(T* arr)
If I use the inline function in MATLAB I can create a single function
Hi could some one please take a look at this and let me know
Non inline function defined in header file with guards #if !defined(HEADER_RANDOM_H) #define HEADER_RANDOM_H void
When trying to inline a function in Visual C++ (2008 express), I got a
$(document).ready(function() { $(span.link).mouseover(function(e){ $(this.children).css(display,inline); }); }); I'm not a javascript expert, but I've cobbled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.