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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:12:31+00:00 2026-05-17T17:12:31+00:00

More specifically what are the characteristics (if any) that delegates have that functions as

  • 0

More specifically what are the characteristics (if any) that delegates have that functions as first class values in F# don’t have; and what are the characteristics that functions as first class values have (if any) that delegates in C# don’t have?

  • 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-17T17:12:31+00:00Added an answer on May 17, 2026 at 5:12 pm

    Delegates and F# “First class function values” are quite different.

    Delegates are a mechanism of the CLR, a type-safe wrapper around function-pointer+object pairs (for instance methods, the this-pointer gets captured together with the method address).

    F# function values on the other hand, are implementation of an abstract class FSharpFunc<,> (it used to be called FastFunc<,> before the official release of F#). Invocation happens via ordinary virtual methods, which is much faster than delegate invocation.
    That is the reason the F#-team didn’t use delegates in the first place.

    So if you can “implement” functions as first class values via abstract classes/virtual methods, why did Microsoft add delegates?

    • There was no alternative In .NET 1.0/1.1, there were no generics, so you had to define a new delegate type (=”function type”) for every function signature you wanted to use.
    • (No, just using interfaces like in Java doesn’t count. 😛 )

    Ok, but we have Generics since .NET 2.0, why do we still have delegates? Why can’t we just use Func<,> and Action<> for everything?

    • Backwards compatibility
    • Multicast Delegates Delegates can be chained together to form new delegates. This mechanism is used to implement events in VB.NET and C#. Behind the scenes, an event is really just a single delegate field. Using the += syntax you essentially add your event-handler-delegate to the chain of delegates in the event field.

    Apart from events, is there a reason to use delegates over FSharpFunc<,>

    Yes, one: Each and every implementation of FSharpFunc<,>, that includes lambda-expressions*, is a new class. And in .NET classes are encoded in the metadata of the compiled assembly. Delegates on the other hand require no extra metadata. The delegate types do but instantiating these delegate types is free in terms of metadata.

    But wait, aren’t C# lambda-expressions/anonymous methods too implemented as hidden classes?

    Yes, C# lambdas take the worst of both worlds ^^

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

Sidebar

Related Questions

More specifically, are there any databases that don't require secondary storage (e.g. HDD) to
I have an information system, more specifically an information system that is a ticketing
More specifically, let's say I have a class template with parameters A and B
More specifically, let's say I have a class template with parameters A and B
More specifically, a class library assembly. My initial thoughts: Have some designated administrators do
More specifically, if I have: public class TempClass : TempInterface { int TempInterface.TempProperty {
I have a box, more specifically a div that will serve as a log
More specifically, does NDK have a complete STL implementation. We're looking at this for
In .Net (VB more specifically, but that doesn't really matter), is there a way
I was of the idea that flash (more specifically Adobe's flash player browser plugin)

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.