algebraic-data-types
Type-safe discriminated unions in C#, or: How to limit the number of implementations of an interface?
First, sorry for the lengthy post. Basically, my question is this: I\'m trying to reproduce the following F# discriminated union type in C#:[详细]
2023-02-16 05:02 分类:问答Haskell "not a visible field of constructor" error
I\'m getting an error I don\'t quite understand: AnotherModule.hs:6:38: `something\' is not a (visible) field of constructor `M.SomeType\'[详细]
2023-02-16 02:59 分类:问答Recursive bottom-up traversal of algebraic data types
When dealing with sizeable algebraic data types in Haskell, there is a particular recursive traversal not captured by folding over the data type. For instance, suppose I have a simple data type repres[详细]
2023-02-08 12:34 分类:问答Overhead of using classes for matrix of algebraic structures in C++
I am using C++ to code some complicated FFT algorithm, so I need to implement such algebraic structures as quaternions and Hamilton-Eisenstein codes. Algorithm works with 2D array of that structures.[详细]
2023-02-01 05:50 分类:问答Is there a Haskell equivalent of OOP's abstract classes, using algebraic data types or polymorphism?
In Haskell, is it possible to write a function with a signature that can accept two different (althoug开发者_Python百科h similar) data types, and operate differently depending on what type is passed i[详细]
2023-01-21 08:17 分类:问答Is it possible to define new ADTs in GHCi
While commenting on new features in ghci I wished that ghci had the ability to declare type declaration and declaring new ADT types, someone informed that it was indeed possible, and after searching I[详细]
2023-01-18 18:29 分类:问答Is there any algebraic structures used in functional programming other then monoid?
I recently getting to know about functional programming (in Haskell and Scala). It\'s capabilities and elegance is quite charming.[详细]
2023-01-08 15:04 分类:问答Memory footprint of Haskell data types
How can I find the actual amount of memory required to store a value of some data type in Haskell (mostly with GHC)? Is it possible to evaluate it at runtime (e.g. in GHCi) or i开发者_开发百科s it pos[详细]
2023-01-07 01:55 分类:问答ADTs in F# and Scala [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a[详细]
2022-12-31 14:59 分类:问答Defining recursive algebraic data types in XML XSD
Imagine I have a recursive algebraic data type like this (Haskell syntax): data Expr = Zero One Add Expr Expr[详细]
2022-12-24 18:28 分类:问答