[Haskell-cafe] type-class and subclasses
lloyd allison
proflandy at gmail.com
Thu Apr 10 02:32:49 UTC 2025
I have a general question:
I would like to have a type-class C in which types that are instances of C
have some type parameters and then a subclass S of C where some of the type
parameters of an instance of S are more constrained in some way -- perhaps
by being equal and/or being instances of some other class.
I have an entirely artificial example (att.) that illustrates this
situation and struggled (it's a while since I wrote much Haskell) to get it
past the ghc type checker until stumbling across GADTs which do seem to do
the trick, so I could leave it at that but...
...I am very far from sure that this is the correct way to look at the
problem and am hoping for some illumination.
regards
Lloyd.
--
No AI was used in composing this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20250410/cc135020/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eg.hs
Type: text/x-haskell
Size: 2741 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20250410/cc135020/attachment.hs>
More information about the Haskell-Cafe
mailing list