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 8682193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:42:18+00:00 2026-06-12T21:42:18+00:00

The following (simplified) snippet is taken from an application I’m implementing which consistently uses

  • 0

The following (simplified) snippet is taken from an application I’m implementing which consistently uses Type Parameters resolved statically.

type A< ^B when ^B : (static member MyMember : Unit -> Unit)> = {
  Field : unit
}
type TestA = {
  AField : A< BTy >
}
and BTy = {
  BField : Unit
} with
  static member MyMember () = ()

IntelliSense gives me the following error when I define the type of field AField (AField : A< BTy >) which is: The type ‘BTy’ does not support any operators named ‘MyMember’.

EDITED.
Declaring them separately works, but if I have a mutual reference and I cannot declare a third type to put in the top which contains the common Infos of the two types. What should I do to avoid this problem? Anyway, if I define below the definitions let pluto = ("" :> obj) :?> A< BTy > it works, I imagine because both types are visible from the let binding.

  • 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-06-12T21:42:20+00:00Added an answer on June 12, 2026 at 9:42 pm

    Your implementation @Tomas satisfies the question but there is some hesitation over the style of your solution because it does not respected the functional programming paradigm. I thought to a solution arising from the Type Classes implementation of Haskell.
    Interfaces, abstract classes, etc. have been implemented in order to allow the F# environment to “interact” with the .Net environment, for a reason of uniformity of style the use of code which implements interfaces, abstract classes etc. in a context where no need of interact with the .Net libraries, it is a “Overhead” in my opinion (although F# is a multi-paradigm language). This is the reason why I found the implementation of the Type Classes of Haskell very elegant. Below I implemented through F# the “Haskell Type Class” code to solve my problem.

    type Operations< ^a> = 
      {  
        MyMember : unit -> unit
      }
    
    type A< ^a> = {
      Operations : Operations< ^a>
    }
    
    and TestA = { 
      AField : A< BTy > 
    }
    
    and BTy = { 
      BField : Unit 
    }
    
    let it = 
      let BTy_operations : Operations< BTy > = { MyMember = fun () -> () }
      let A_of_BTy = { Operations = BTy_operations }
      { AField = A_of_BTy }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following simplified code snippet: #include <QtGui> int main(int argc, char **argv) { QApplication app(argc,
I have two tables with the following (simplified) structures: table "Factors" which holds data
As an experiment I ran the following code snippet (simplified): public class SGamePlay extends
I've got the following (simplified) XML... <root type=object> <user type=object> <id type=number>123</id> </user> <id
I have the following (simplified) result from SELECT * FROM table ORDER BY tick,refid
The following code snippet is a simplified version of my issue. Basically I'm trying
I've the following simplified code which describes my problem: public interface IMyUser { int
Consider the following simplified grammar: ID : ('a'..'z') ('a'..'z')*; TYPE : 'int' '[' ']'
I have the following (simplified) code from a generic factory class: - (id) invokeSetup:
Consider the following simplified demonstration: Class X contain Class Y . Class Y has

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.