In Haskell, the class Foldable
is standalone i.e.
class Foldable t where ...
However, in Frege:
class Functor t => Foldable t where ...
Why was this constraint introduced? What ill-formed programs/ideas can it rule out?
It prevented me from defining an instance Foldable HashSet
, where HashSet
is a custom data type which wraps Data.HashMap
to provide a set-based interface. (It can be worked around by applying toList
first, so it's not a serious issue.)