typeclass
Is there any generic Hashable typeclass in Haskell? (a.k.a. "deriving (Hashable)")
Has anyone written a generic function so that hash functions can be generated automatically for custom data types (using the deriving mechanism)? A few times, I\'ve written the following kind of boile[详细]
2023-03-07 22:53 分类:问答Haskell -- get TypeRep from concrete type instance
I want to write a function with this type signature: getTypeRep :: Typeable a => t a -> TypeRep where the TypeRep will be the type representation for a, not fo开发者_JAVA百科r t a. That is, t[详细]
2023-03-04 14:39 分类:问答Why can I not make String an instance of a typeclass?
Given: data Foo = FooString String … class Fooable a where --(is this a good way to name this?) toFoo :: a -> Foo[详细]
2023-03-04 13:40 分类:问答Overriding (==) in Haskell
I have the following algebraic data types: data Exp = Con Int Var String Op开发者_JAVA技巧 Opkind Exp Exp[详细]
2023-03-03 22:39 分类:问答How does object ordering work?
at first I should say that I have never seen any Haskell code. Now I have an algorithm which I have to implement in another language. Unfortunately, this algorithm relies on some Haskell characteristi[详细]
2023-03-03 07:09 分类:问答Haskell -- bidirectional class instance type implications OR GADT existential type qualifications?
I have a GADT defined like (abbreviated), {-# LANGUAGE StandaloneDeriving #-} data D t where C :: t -> D t[详细]
2023-03-02 14:07 分类:问答Transform Parameterized Type (With Inferred Parameter)
I have a data type which carries a \'hidden\' (inferred) type and a concrete value. Now I try to implement a function which changes both of these but am unable to make it pass GHC.[详细]
2023-03-02 07:20 分类:问答Design of interface abstraction
Currently, I try to write a small game program (Skat) as a hobby project. Skat is a trick-taking game were two players play against a single player. As there are different kinds of players (lokal play[详细]
2023-02-28 22:00 分类:问答Polymorphism scenario in Haskell
I have written the following Haskell program to interpret basic math. I would like to add comparison and boolean operators in addition to mathematical operators. My question is how I should go about r[详细]
2023-02-28 18:44 分类:问答Eq instance has some strange comparisons
I have made an image processing module that defines a Pixel type as a Color and Location. Pixel, Color, and Location derive Eq, as I may want to compare pixels between multiple images.[详细]
2023-02-28 13:11 分类:问答