[Haskell-cafe] Type alias in constraints

Sylvain Henry sylvain at haskus.fr
Fri Oct 14 17:25:40 UTC 2016


Hi,

I have been using constraints of the form:

xxx :: forall x xs ys zs m.
    ( Monad m
    , zs ~ Union (Filter x xs) ys
    , Catchable x xs
    , Liftable (Filter x xs) zs
    , Liftable ys zs
    ) => Variant xs -> (x -> Flow m ys) -> Flow m zs

Where "zs" is used as a type alias. Now with GHC8 and 
-Wredundant-constraints, GHC complaints that "zs" is redundant (indeed 
it is).

Is there a way to do this properly? If not, could we introduce a new 
syntax to make this kind of local declaration? We could borrow the 
syntax of local declarations into list-comprehensions: "let zs ~ ..."

Thanks,
Sylvain



More information about the Haskell-Cafe mailing list