-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
status:Composing error messageImproving the error message is under discussion and WIPImproving the error message is under discussion and WIPtool:GHCFor error messages originating from GHCFor error messages originating from GHCtype:error-messageThis issue focuses on improving a error messaging in Haskell ToolsThis issue focuses on improving a error messaging in Haskell Tools
Description
In this stackoverflow question the asker presents this code:
{-# LANGUAGE TypeFamilies #-}
class Reproductive a where
-- | A sequence of genetic information for an agent.
type Strand a
-- | Full set (both strands) of genetic information for an organism.
type Genome a = (Strand a, Strand a)But this produces the unhelpful error message (I was confused for a minute):
Assoc.hs:20:8: error:
‘Genome’ is not a (visible) associated type of class ‘Reproductive’
|
20 | type Genome a = (Strand a, Strand a)
| ^^^^^^
As a user I'm thinking that I'm defining an associated type, but this error message says that it expects the type to already be defined.
I now understand that you can easily solve this by writing a separate "kind signature" where the signature part can be omitted because it defaults to *:
{-# LANGUAGE TypeFamilies #-}
class Reproductive a where
-- | A sequence of genetic information for an agent.
type Strand a
-- | Full set (both strands) of genetic information for an organism.
type Genome a
type Genome a = (Strand a, Strand a)I think this warning can be improved, but I'm not sure how, yet.
Abastro
Metadata
Metadata
Assignees
Labels
status:Composing error messageImproving the error message is under discussion and WIPImproving the error message is under discussion and WIPtool:GHCFor error messages originating from GHCFor error messages originating from GHCtype:error-messageThis issue focuses on improving a error messaging in Haskell ToolsThis issue focuses on improving a error messaging in Haskell Tools