Support type classes or implicits
NOTE: Current response by @dsyme is here: https://github.com/fsharp/fslang-suggestions/issues/243#issuecomment-916079347 ----- **Submitted by exercitus vir on 4/12/2014 12:00:00 AM** **392 votes on UserVoice prior to migration** (Updated the suggestion to "type classes or implicits", and edited it) Please add support for type classes or implicits. Currently, it's possible to hack type classes into F# using statically resolved type parameters and operators, but it is really ugly and not easily extensible. I'd like to see something similar to an interface declaration: ``` fsharp class Mappable = abstract map : ('a -> 'b) -> 'm<'a> -> 'm<'b> ``` Existing types could then be made instances of a type classes by writing them as type extensions: ``` fsharp type Seq with class Mappable with member map = Seq.map type Option with class Mappable with member map = Option.map ``` I know that the 'class' keyword could be confusing for OO-folks but I could not come up with a better keyword for a type class but since 'class' is not used in F# anyway, this is probably less of a problem. **[Original UserVoice Submission](https://fslang.uservoice.com/forums/245727-f-language/suggestions/5762135)** [Archived Uservoice Comments](../tree/master/archive/suggestion-5762135-support-for-type-classes-or-implicits.md#comments)
Posted by baronfel on Oct 20, 2016, 2:35 AM
Tags
Related issues
- Add 65536 size support for maps
- TypeScript 7.1 Iteration Plan
- nvim-treeconfig: upstream nvim-treesitter
- Add the "action" and "method" attributes to <button>
- [FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
- > We were imposed GitHub for so many exercises!
Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments
support (Software)
Add 65536 size support for maps
TypeScript 7.1 Iteration Plan
nvim-treeconfig: upstream nvim-treesitter
Add the "action" and "method" attributes to <button>
[FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
> We were imposed GitHub for so many exercises!
Add support for Visual Studio 2026 Integration
Support for Helm v4
Support type classes or implicits
NOTE: Current response by @dsyme is here: https://github.com/fsharp/fslang-suggestions/issues/243#issuecomment-916079347 ----- **Submitted by exercitus vir on 4/12/2014 12:00:00 AM** **392 votes on UserVoice prior to migration** (Updated the suggestion to "type classes or implicits", and edited it) Please add support for type classes or implicits. Currently, it's possible to hack type classes into F# using statically resolved type parameters and operators, but it is really ugly and not easily extensible. I'd like to see something similar to an interface declaration: ``` fsharp class Mappable = abstract map : ('a -> 'b) -> 'm<'a> -> 'm<'b> ``` Existing types could then be made instances of a type classes by writing them as type extensions: ``` fsharp type Seq with class Mappable with member map = Seq.map type Option with class Mappable with member map = Option.map ``` I know that the 'class' keyword could be confusing for OO-folks but I could not come up with a better keyword for a type class but since 'class' is not used in F# anyway, this is probably less of a problem. **[Original UserVoice Submission](https://fslang.uservoice.com/forums/245727-f-language/suggestions/5762135)** [Archived Uservoice Comments](../tree/master/archive/suggestion-5762135-support-for-type-classes-or-implicits.md#comments)
Comments (0)
No comments yet. Start the discussion.