WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

GHC 7.10.2 compilation error in CV.Matrix in the use of ‘fromEnum’ #53

@robstewart57

Description

@robstewart57

There is an ambiguity of deep in CV.Image because Control.Lens exports deep. It can be resolved with:

-    getSize (Mutable i) = evaluate (deep (getSize i))
+    getSize (Mutable i) = evaluate (CV.Image.deep (getSize i))

Once that is resolved, I'm getting two errors in CV.Matrix:

[20 of 62] Compiling CV.Matrix        ( CV/Matrix.hs, dist/build/CV/Matrix.o )

CV/Matrix.hs:145:83:
    Could not deduce (Enum r0) arising from a use of ‘fromEnum’
    from the context (Exists (Matrix a),
                      Args (Matrix a) ~ Size (Matrix a))
      bound by the type signature for
                 invert :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) =>
                           Matrix a -> Matrix a
      at CV/Matrix.hs:141:11-88
    The type variable ‘r0’ is ambiguous
    Note: there are several potential instances:
      instance Enum CV.Image.CvtCodes -- Defined at CV/Image.chs:474:10
      instance Enum CV.Image.CvtFlags -- Defined at CV/Image.chs:515:10
      instance Enum ImageDepth -- Defined at CV/Image.chs:963:10
      ...plus 76 others
    In the second argument of ‘(.)’, namely ‘fromEnum’
    In the expression: fromIntegral . fromEnum
    In the third argument of ‘c'cvInvert’, namely
      ‘(fromIntegral . fromEnum $ c'CV_LU)’

CV/Matrix.hs:145:94:
    Could not deduce (Num r0) arising from a use of ‘c'CV_LU’
    from the context (Exists (Matrix a),
                      Args (Matrix a) ~ Size (Matrix a))
      bound by the type signature for
                 invert :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) =>
                           Matrix a -> Matrix a
      at CV/Matrix.hs:141:11-88
    The type variable ‘r0’ is ambiguous
    Note: there are several potential instances:
      instance RealFloat a => Num (Data.Complex.Complex a)
        -- Defined in ‘Data.Complex’
      instance Data.Fixed.HasResolution a => Num (Data.Fixed.Fixed a)
        -- Defined in ‘Data.Fixed’
      instance forall (k :: BOX) (f :: k -> *) (a :: k).
               Num (f a) =>
               Num (Data.Monoid.Alt f a)
        -- Defined in ‘Data.Monoid’
      ...plus 67 others
    In the second argument of ‘($)’, namely ‘c'CV_LU’
    In the third argument of ‘c'cvInvert’, namely
      ‘(fromIntegral . fromEnum $ c'CV_LU)’
    In the expression:
      c'cvInvert c_m c_c (fromIntegral . fromEnum $ c'CV_LU)

Have others come across this error? and have others been able to compile this CV library with GHC 7.10?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions