There are some problems which are easily solved by Algebraic Data Types, for example a List type can be very succinctly expressed as: data ConsList a = Empty | ConsCell a (ConsList a) consmap f ...
Fair warning, I'm new to functional programming so I may hold many bad assumptions. I've been learning about algebraic types. Many functional languages seem to have them, and they are fairly useful ...
Every now and then I have peaked at Haskell Tutorials and found the Algebraic data types quite interesting. I took their purpose to be to represent types that have completely separable states. Sadly, ...
How do you go about deciding which of the following two representations (in F# syntax) is the right choice in a particular situation? type Choice = A of string | B of string Or: type ChoiceKind = ...
Does standard UML specify how a variant (aka tagged union, discriminated union, sum type, etc) should be depicted in a class diagram?
I'm being warned that the Monoid I'm creating is an Orphan Instance. Is there a better way to write this functionality in?
type PromptSegment = IO (Maybe String) instance Monoid a => Monoid (IO a) where mempty = return mempty mappend = liftA2 (<>) This behaves exactly how I want for my purposes. For ...
One of the things I like about the new Apple language Swift is that it combines procedural programming with algebraic data types. What other languages do this?
Working in immutable data with single assignments has the obvious effect of requiring more memory, one would presume, because you're constantly creating new values (though compilers under the covers ...
I am designing a logic analyzer and I would like to implement some Matrix Algorithm. I have several channels each one represented by a row in the matrix and every element in the column would be the ...