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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -