Tagged Questions

Algebraic data types are data structures built from sums, products and recursive types, admitting an algebra. Descriptions of types given as ADTs may be manipulated symbolically to derive other related data structures. The logic for building types algebraically is related to combinatorial species in ...

An application may operate in two modes - "real time" where it looks at every update to the state of the world, or "sampled" where it only looks at the state of the world every T milliseconds.
If I ...

So, I have that Huffman tree, that is used for encoding strings. And I have defined the function plant, but I am not sure whether my tree is not tilting too much only to the one side. Here is my code:
...

In Haskell, it is said that any ADT can be expressed as sum of products. I'm trying to find a flat type that is isomorphic to Tree, on Data.Tree.
Tree a = Node a [Tree a] -- has a nested type (List!)
...

An ADT can be represented using the Scott Encoding by replacing products by tuples and sums by matchers. For example:
data List a = Cons a (List a) | Nil
Can be encoded using the Scott Encoding as:
...

I'm using ADTs that should only be able to be constructed after a validation step (which is common practice in FP to ensure correctness). As an example, I'm using a Score type on top of Double, which ...

According to the theory of ADTs (Algebraic Data Types) the concatenation of two lists has to take O(n) where n is the length of the first list. You, basically, have to recursively iterate through the ...

Problem:
Recently I asked the following question on here, asking how to create a generic map function, and a generic instance of Functor for any arbitrary polymorphic ADT (Algebraic Data Type), like ...

This question has been asked back in 2012 , but I'm looking for new updates.
Are there any serialization formats that support tagged unions (aka sum types)? My requirements are that it has Java and ...

Does Idris do any kind of optimization under the hood of vectors? Because from the looks of it, an Idris vector is just a linked list with known size (known at compile time). In fact, in general it ...

It's written that Haskell tuples are simply a different syntax for algebraic data types. Similarly, there are examples of how to redefine value constructors with tuples.
For example, a Tree data type ...

They were implemented in Idris 0.9.14 and I successfully used induction for some proofs. However, they work only for some library types; while, for example, Vect supports them, nearly-isomorphic All ...

I am trying to perform a quadratic optimization on an algebraic variety. I'm using MATLAB to do this. I'm not very experienced in programming or MATLAB and I can't figure out what is wrong with this ...

I want to write some functions that work over all data types in Haskell (at least all instances of Data from Data.Data). A general problem I ran into is making a choice of what to do based on whether ...

Is it possible to define a simple syntactic notion of equality (similar to what GHC might automatically derive as the Eq instance for a Haskell 98 type), without either explicitly proving that each ...

I'm trying to use Z3 to solve equations involving unknown projection functions, to find a valid interpretation of the functions that satisfy the equation. So for example for the equation: snd . f = g ...

Basically, what I want is a function that takes a function type (a -> b -> c -> ...), and returns a list of all the right-subset types of that function type, for example, lets call this function f:
x ...