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

compilation fails with ghc >= 7.10 since notElem uses Foldable now #8

Open
jwaldmann opened this issue Jan 23, 2017 · 0 comments
Open

Comments

@jwaldmann
Copy link

[2 of 2] Compiling Language.SMTLIB  ( Language/SMTLIB.hs, dist/build/Language/SMTLIB.o )

Language/SMTLIB.hs:819:22: error:
    • Ambiguous type variable ‘t0’ arising from a use of ‘notElem’
      prevents the constraint ‘(Foldable t0)’ from being solved.

for this snippet of code:

clean = filter (flip notElem " \t\r\n") . unlines . map (takeWhile (/= ';')) . lines

Because of:

notElem :: Eq a => a -> [a] -> Bool   -- for ghc up to 7.8.4
notElem :: (Eq a, Foldable t) => a -> t a -> Bool -- since ghc 7.10.3 (at least)

The fix is trivial ( 2f072c7 )

clean = filter (flip notElem (" \t\r\n" :: String)) . unlines . map (takeWhile (/= ';')) . lines
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

1 participant