Questions tagged [deriving]

In Haskell, a derived instance is an instance declaration that is generated automatically in conjunction with a data or newtype declaration. The body of a derived instance declaration is derived syntactically from the definition of the associated type.

In Haskell, a derived instance is an instance declaration that is generated automatically in conjunction with a data or newtype declaration. The body of a derived instance declaration is derived syntactically from the definition of the associated type.

139 questions
0
votes
1 answer

Deriving instance Typeable with context

I am writing function set wor working with HTTP requests and need to create a set of Exceptions for handling failures. Here it is data HStream ty => ErrorResponse ty = ErrorResponse (Response ty) data HStream ty => HttpException ty =…
Andrey Kuznetsov
  • 11,640
  • 9
  • 47
  • 70
0
votes
2 answers

Deriving Data.Complex in Haskell

I have code that looks a little like the following: import Data.Complex data Foo = N Number | C ComplexNum data Number = Int Integer | Real Float | Rational Rational deriving Show data ComplexNum = con1…
user3125280
  • 2,779
  • 1
  • 14
  • 23
0
votes
1 answer

Deriving currently on loan items

I have a table of loan information. example: _________________________________________________________________ |id|LoanDate|EquipmentId|FromUser|FromLocation|ToUser|ToLocation| |---------------------------------------------------------------| |1…
Mike
  • 1,532
  • 3
  • 21
  • 45
-3
votes
1 answer

How to call the base constructor if your class derives from unique_ptr

How can do I implement the SearchTree constructor with the T type parameter by calling it's superclass ? template class SearchTree: protected unique_ptr >{ public: SearchTree(); SearchTree(const T &);…
Agnaroc
  • 167
  • 2
  • 10
1 2 3
9
10