Remove "Data t =>" qualifications from transformation types.
This is solely because GHC 6.6 doesn't like them (it complains about the type variable already being in scope -- which it is, but there's nothing I can do about that!). This doesn't lose any safety; if you try to write a transformation for something that's not Data you'll find out when you try to pass it to one of the application functions.
This commit is contained in:
parent
7525138c96
commit
7d9110a9b0
|
@ -33,17 +33,16 @@ import Pass
|
||||||
-- | A transformation for a single 'Data' type with explicit descent.
|
-- | A transformation for a single 'Data' type with explicit descent.
|
||||||
-- The first argument passed is a function that can be called to explicitly
|
-- The first argument passed is a function that can be called to explicitly
|
||||||
-- descend into a generic value.
|
-- descend into a generic value.
|
||||||
type ExplicitTrans t = Data t =>
|
type ExplicitTrans t = (forall s. Data s => s -> PassM s) -> t -> PassM t
|
||||||
(forall s. Data s => s -> PassM s) -> t -> PassM t
|
|
||||||
|
|
||||||
-- | A transformation for a single 'Data' type with implicit descent.
|
-- | A transformation for a single 'Data' type with implicit descent.
|
||||||
-- This can be applied recursively throughout a data structure.
|
-- This can be applied recursively throughout a data structure.
|
||||||
type Transform t = Data t => t -> PassM t
|
type Transform t = t -> PassM t
|
||||||
|
|
||||||
-- | A check for a single 'Data' type with implicit descent.
|
-- | A check for a single 'Data' type with implicit descent.
|
||||||
-- This is like 'Transform', but it doesn't change the value; it may fail or
|
-- This is like 'Transform', but it doesn't change the value; it may fail or
|
||||||
-- modify the state, though.
|
-- modify the state, though.
|
||||||
type Check t = Data t => t -> PassM ()
|
type Check t = t -> PassM ()
|
||||||
|
|
||||||
-- | Make an 'ExplicitTrans' that applies a 'Transform', recursing depth-first.
|
-- | Make an 'ExplicitTrans' that applies a 'Transform', recursing depth-first.
|
||||||
transformToExplicitDepth :: Data t => Transform t -> ExplicitTrans t
|
transformToExplicitDepth :: Data t => Transform t -> ExplicitTrans t
|
||||||
|
|
Loading…
Reference in New Issue
Block a user