generics - Haskell construct a type contains class -
i want construct haskell type:
type singlepp = (string,glattice)
where glattice defined as:
class glattice l join :: l->l->l ....
is there way me that?
type singlepp = (string, a)
and when use singlepp
in function, restrict a
glattice
somefunc :: glattice => singlepp -> () somefunc = domagic
if like, can use more type system-foo , go existential types, let avoid boilerplate after each function, in exchange must use language extension , data
declaration explicit constructor. means more pattern matching when want @ a
less typing in type declarations.
however of types can inferred.
Comments
Post a Comment