music-suite / music-score

This repo has been merged into: https://github.com/music-suite/music-suite
http://music-suite.github.io
BSD 3-Clause "New" or "Revised" License
52 stars 10 forks source link

Fails to build with GHC 7.10.2 #344

Closed bshepherdson closed 4 years ago

bshepherdson commented 8 years ago

I get the following errors:

[66 of 76] Compiling Music.Score.Export.Lilypond ( src/Music/Score/Export/Lilypond.hs, dist/build/Music/Score/Export/Lilypond.o )

src/Music/Score/Export/Lilypond.hs:223:10:
    Could not deduce (Part c0 ~ Part e0)
    from the context (HasDynamicNotation a b c,
                      HasArticulationNotation c d e,
                      Part e ~ Part c,
                      HasOrdPart a,
                      Transformable a,
                      Semigroup a,
                      Tiable e,
                      HasOrdPart c,
                      Show (Part c),
                      HasLilypondInstrument (Part c),
                      Satisfied)
      bound by an instance declaration:
                 (HasDynamicNotation a b c, HasArticulationNotation c d e,
                  Part e ~ Part c, HasOrdPart a, Transformable a, Semigroup a,
                  Tiable e, HasOrdPart c, Show (Part c),
                  HasLilypondInstrument (Part c), Satisfied) =>
                 HasBackendScore Lilypond (Score a)
      at src/Music/Score/Export/Lilypond.hs:(223,10)-(234,39)
    NB: ‘Part’ is a type function, and may not be injective
    The type variables ‘c0’, ‘e0’ are ambiguous
    In the ambiguity check for an instance declaration:
      forall a b c d e.
      (HasDynamicNotation a b c, HasArticulationNotation c d e,
       Part e ~ Part c, HasOrdPart a, Transformable a, Semigroup a,
       Tiable e, HasOrdPart c, Show (Part c),
       HasLilypondInstrument (Part c), Satisfied) =>
      HasBackendScore Lilypond (Score a)
    To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
    In the instance declaration for
      ‘HasBackendScore Lilypond (Score a)’

If I try to add the suggested AllowAmbiguousTypes I get:

[66 of 76] Compiling Music.Score.Export.Lilypond ( src/Music/Score/Export/Lilypond.hs, dist/build/Music/Score/Export/Lilypond.o )

src/Music/Score/Export/Lilypond.hs:258:26:
    Could not deduce (Articulation b0 ~ Ctxt a0)
    from the context (HasBackend Lilypond,
                      HasDynamicNotation a b c,
                      HasArticulationNotation c d e,
                      Part e ~ Part c,
                      HasOrdPart a,
                      Transformable a,
                      Semigroup a,
                      Tiable e,
                      HasOrdPart c,
                      Show (Part c),
                      HasLilypondInstrument (Part c),
                      Satisfied)
      bound by the instance declaration
      at src/Music/Score/Export/Lilypond.hs:(224,10)-(235,39)
    The type variables ‘a0’, ‘b0’ are ambiguous
    Expected type: ASetter
                     (Score b0) (Score e) (Ctxt a0) ArticulationNotation
      Actual type: (Articulation (Score b0)
                    -> Identity (Articulation (Score e)))
                   -> Score b0 -> Identity (Score e)
    In the first argument of ‘over’, namely ‘articulations’
    In the second argument of ‘($)’, namely
      ‘over articulations notateArticulation’

src/Music/Score/Export/Lilypond.hs:259:34:
    Could not deduce (Articulation b0 ~ Ctxt (Articulation a1))
    from the context (HasBackend Lilypond,
                      HasDynamicNotation a b c,
                      HasArticulationNotation c d e,
                      Part e ~ Part c,
                      HasOrdPart a,
                      Transformable a,
                      Semigroup a,
                      Tiable e,
                      HasOrdPart c,
                      Show (Part c),
                      HasLilypondInstrument (Part c),
                      Satisfied)
      bound by the instance declaration
      at src/Music/Score/Export/Lilypond.hs:(224,10)-(235,39)
    The type variables ‘b0’, ‘a1’ are ambiguous
    In the first argument of ‘preserveMeta’, namely ‘addArtCon’
    In the second argument of ‘($)’, namely ‘preserveMeta addArtCon’
    In the first argument of ‘map’, namely
      ‘(second $ preserveMeta addArtCon)’

src/Music/Score/Export/Lilypond.hs:262:21:
    Could not deduce (Dynamic a1 ~ DynamicNotation)
    from the context (HasBackend Lilypond,
                      HasDynamicNotation a b c,
                      HasArticulationNotation c d e,
                      Part e ~ Part c,
                      HasOrdPart a,
                      Transformable a,
                      Semigroup a,
                      Tiable e,
                      HasOrdPart c,
                      Show (Part c),
                      HasLilypondInstrument (Part c),
                      Satisfied)
      bound by the instance declaration
      at src/Music/Score/Export/Lilypond.hs:(224,10)-(235,39)
    The type variable ‘a1’ is ambiguous
    In the second argument of ‘($)’, namely ‘removeCloseDynMarks’
    In the first argument of ‘map’, namely
      ‘(second $ removeCloseDynMarks)’
    In the first argument of ‘(.)’, namely
      ‘map (second $ removeCloseDynMarks)’

src/Music/Score/Export/Lilypond.hs:263:26:
    Could not deduce (Dynamic b1 ~ Ctxt a2)
    from the context (HasBackend Lilypond,
                      HasDynamicNotation a b c,
                      HasArticulationNotation c d e,
                      Part e ~ Part c,
                      HasOrdPart a,
                      Transformable a,
                      Semigroup a,
                      Tiable e,
                      HasOrdPart c,
                      Show (Part c),
                      HasLilypondInstrument (Part c),
                      Satisfied)
      bound by the instance declaration
      at src/Music/Score/Export/Lilypond.hs:(224,10)-(235,39)
    The type variables ‘a2’, ‘b1’ are ambiguous
    Expected type: ASetter
                     (Score b1) (Score a1) (Ctxt a2) DynamicNotation
      Actual type: (Dynamic (Score b1)
                    -> Identity (Dynamic (Score a1)))
                   -> Score b1 -> Identity (Score a1)
    In the first argument of ‘over’, namely ‘dynamics’
    In the second argument of ‘($)’, namely
      ‘over dynamics notateDynamic’

src/Music/Score/Export/Lilypond.hs:264:34:
    Could not deduce (Dynamic b1
                      ~ Ctxt (Dynamic (SetDynamic (Dynamic a) a)))
    from the context (HasBackend Lilypond,
                      HasDynamicNotation a b c,
                      HasArticulationNotation c d e,
                      Part e ~ Part c,
                      HasOrdPart a,
                      Transformable a,
                      Semigroup a,
                      Tiable e,
                      HasOrdPart c,
                      Show (Part c),
                      HasLilypondInstrument (Part c),
                      Satisfied)
      bound by the instance declaration
      at src/Music/Score/Export/Lilypond.hs:(224,10)-(235,39)
    The type variable ‘b1’ is ambiguous
    Relevant bindings include
      normScore :: Score a
        (bound at src/Music/Score/Export/Lilypond.hs:274:7)
      score :: Score a
        (bound at src/Music/Score/Export/Lilypond.hs:251:17)
      exportScore :: Lilypond
                     -> Score a
                     -> BackendScore
                          Lilypond
                          (BackendContext Lilypond (BackendScoreEvent Lilypond (Score a)))
        (bound at src/Music/Score/Export/Lilypond.hs:251:3)
    In the first argument of ‘preserveMeta’, namely ‘addDynCon’
    In the second argument of ‘($)’, namely ‘preserveMeta addDynCon’
    In the first argument of ‘map’, namely
      ‘(second $ preserveMeta addDynCon)’

I have no experience with this kind of heavy typeclass magic, so I'm at a loss for trying to debug it.

hanshoglund commented 4 years ago

This repo has been merged into: https://github.com/music-suite/music-suite which should build fine. Please report any new issues there!

Closing this :)