Created
November 26, 2013 08:32
-
-
Save bergmark/7655113 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE RankNTypes #-} | |
| module Test where | |
| import Data.Data (Data) | |
| import Data.Generics.Uniplate.Data | |
| import Data.Typeable (Typeable) | |
| import Language.Haskell.Exts.Annotated hiding (binds, loc) | |
| import Prelude hiding (exp) | |
| desugarPatField :: forall l. (Data l, Typeable l) => Module l -> Module l | |
| desugarPatField = t $ \pf -> case pf of | |
| -- {a} => {a=a} for R{a} | |
| PFieldPun l n -> PFieldPat l (UnQual l n) (PVar l n) | |
| _ -> pf | |
| where | |
| t :: (Data l, Typeable l) => (PatField l -> PatField l) -> Module l -> Module l | |
| t = transformBi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment