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

  • Home
  • SEARCH
  • 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 7888833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:56:16+00:00 2026-06-03T05:56:16+00:00

Ok, C# has Explictit Interface Implementation I’l like to do similar in F#. I

  • 0

Ok, C# has Explictit Interface Implementation
I’l like to do similar in F#.

I have some Interfaces (and classes)

type IState = interface
    abstract member Update : IAction-> IState
    ...
end
type IEnviroment = interface
    abstract member Update : IAction-> IEnviroment
    ...
    end


type IBoard  = 
    inherit IState
    inherit IEnviroment
    abstract member Update : Move -> IBoard
    ...

[<AbstractClass>]
and Move ()= 
    abstract member Apply : IBoard -> IBoard
    interface IAction with        
        override this.Cost = 1M

So the problem I have is that Update is defined 3 times differently.
So I need the equivelent of C#’s Explictit Interface Implementation,
I’me thinking I’ld implement it in the interface (since that is legit in F#) – it would just consist of some typecasts.

My understanding is that all interface implementation in F# is explcit, in classes,
But once an interface inherits from another inferface, then you only (explicitly) implement that one.
(so my Board class only implments I Board)

  • 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-03T05:56:17+00:00Added an answer on June 3, 2026 at 5:56 am

    I tried the syntax member this.IState.Update in the implementation of IBoard, but the compiler rejected it.

    I don’t see a way in the spec to do what you want.

    Here is a work-around in for such name clashes, using an abstract class to forward calls to each interface.

    type I1 =
        interface
            abstract F : unit -> unit
        end
    
    type I2 =
        interface
            abstract F : unit -> unit
        end
    
    type II =
        interface
            inherit I1
            inherit I2
            abstract F : unit -> unit
        end
    
    [<AbstractClass>]
    type III() =
        abstract F1 : unit -> unit
        abstract F2 : unit -> unit
        abstract F3 : unit -> unit
        interface I1 with
            member this.F() = this.F1()
        interface I2 with
            member this.F() = this.F2()
    
    type Works() =
        inherit III()
        override this.F1() = printfn "F1"
        override this.F2() = printfn "F2"
        override this.F3() = printfn "F3"
    
    type Fails() =
        interface II with
            member this.F() = ()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some code that looks like this: class Serializer { public: template<class Type>
Suppose i have a interface like this, interface MyIntf{ void generate(); } and a
In VB.NET (using Visual Studio 2008) my WCF service has an interface something like:
Let's say I have a class that implements the IDisposable interface. Something like this:
I'm implementing some type ( MyType in the example below) which has a Collection
Has there been discussion around how to resolve equivalent openids? Meaning, I personally have
Has anyone migrated a VB6 project to .Net with Visual Studio 2010? I have
In my iOS application's interface I have explicit undo & redo button (shake-to-undo is
To convert between some LINQ to SQL objects and DTOs we have created explicit
I am working with a COM plugin interface that has the following function definition:

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.