Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskell-src-exts 1.17 #28

Open
nomeata opened this issue Jan 31, 2016 · 1 comment
Open

haskell-src-exts 1.17 #28

nomeata opened this issue Jan 31, 2016 · 1 comment

Comments

@nomeata
Copy link

nomeata commented Jan 31, 2016

Hi,

it seems that hothasktags needs to be adjusted to work with the latest haskell-src-exts:

Main.hs:134:21:
    Constructor `L.EVar' should have 2 arguments, but has been given 3
    In the pattern: L.EVar _ _ (L.UnQual _ (L.Ident _ name'))
    In an equation for `matchesSpec':
        matchesSpec nm (L.EVar _ _ (L.UnQual _ (L.Ident _ name')))
          = nm == name'
    In an equation for `exported':
        exported
          mod'@(L.Module _
                         (Just (L.ModuleHead _ _ _ (Just (L.ExportSpecList _ specs))))
                         _
                         _
                         _)
          name
          = any (matchesSpec name) specs
          where
              matchesSpec nm (L.EVar _ _ (L.UnQual _ (L.Ident _ name')))
                = nm == name'
              matchesSpec nm (L.EAbs _ (L.UnQual _ (L.Ident _ name')))
                = nm == name'
              matchesSpec nm (L.EThingAll _ (L.UnQual _ (L.Ident _ name')))
                = nm == name' || (nm `elem` thingMembers mod' name')
              matchesSpec
                nm
                (L.EThingWith _ (L.UnQual _ (L.Ident _ name')) cnames)
                = nm == name' || any (matchesCName nm) cnames
              matchesSpec _ (L.EModuleContents _ (L.ModuleName _ _)) = False
              matchesSpec _ _ = False
              matchesCName nm (L.VarName _ (L.Ident _ name')) = nm == name'
              matchesCName nm (L.ConName _ (L.Ident _ name')) = nm == name'
              matchesCName _ _ = False

Main.hs:192:21:
    Constructor `L.IVar' should have 2 arguments, but has been given 3
    In the pattern: L.IVar _ _ (L.Ident _ name')
    In an equation for `specName':
        specName (L.IVar _ _ (L.Ident _ name')) = [name']
    In an equation for `extractImport':
        extractImport
          decl@(L.ImportDecl {L.importModule = L.ModuleName _ name,
                              L.importSpecs = spec})
          = let
              extraExports
                | Just (L.ModuleHead _
                                     _
                                     _
                                     (Just (L.ExportSpecList _ especs))) <- modhead
                = Map.unions ...
                | otherwise = Map.empty
            in
              Map.unions
                [if L.importQualified decl then Map.empty else names,
                 Map.mapKeys ((name ++ ".") ++) names, ....]
          where
              names
                | Just (L.ImportSpecList _ True specs) <- spec
                = let ... in normalExports `Map.difference` Map.fromList s
                | Just (L.ImportSpecList _ False specs) <- spec
                = let ... in Map.filterWithKey f normalExports
                | otherwise = normalExports
              normalExports = modExports db name
              specName (L.IVar _ _ (L.Ident _ name')) = [name']
              specName (L.IAbs _ (L.Ident _ name')) = [name']
              specName (L.IThingAll _ (L.Ident _ name')) = [name']
              specName (L.IThingWith _ (L.Ident _ name') cnames)
                = name' : concatMap cname cnames
              specName _ = []
              cname (L.VarName _ (L.Ident _ name')) = [name']
              cname (L.ConName _ (L.Ident _ name')) = [name']
              cname _ = []

Furtheremore, upper bounds on haskell-src-exts would be prudent, given that they regularly change the API. And you might want to join stackage so that you will be notified of these issues before your users notice.

Thanks,
Joachim

@spwhitton
Copy link
Contributor

A merged PR fixed this issue, AFAIK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants