ghcjs / jsaddle

JavaScript interface that works with GHCJS or GHC
116 stars 62 forks source link

CC constructor type mismatch when using text-2.0.1 #135

Closed avanov closed 2 months ago

avanov commented 1 year ago

A few screens of compilation errors, mostly having the same pattern of a type mismatch while constructing CC from text-2.0.1. Using jsaddle-0.9.8.2 with a manual boundary override for text.

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:553:47-54: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\x0066'’
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0066' '\x0069')’
      In the expression: Yield '\x0066' (CC s '\x0066' '\x0069')
    |
553 | foldMapping '\xfb03' s = Yield '\x0066' (CC s '\x0066' '\x0069')
    |                                               ^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:555:42-63: error:
    • Couldn't match expected type: Char -> CC s
                  with actual type: CC s
    • The function ‘CC’ is applied to three value arguments,
        but its type ‘s -> GHC.Int.Int64 -> CC s’ has only two
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0066' '\x006c')’
      In the expression: Yield '\x0066' (CC s '\x0066' '\x006c')
    • Relevant bindings include
        s :: s
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:555:22)
        foldMapping :: Char -> s -> Step (CC s) Char
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:327:1)
    |
555 | foldMapping '\xfb04' s = Yield '\x0066' (CC s '\x0066' '\x006c')
    |                                          ^^^^^^^^^^^^^^^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:555:47-54: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\x0066'’
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0066' '\x006c')’
      In the expression: Yield '\x0066' (CC s '\x0066' '\x006c')
    |
555 | foldMapping '\xfb04' s = Yield '\x0066' (CC s '\x0066' '\x006c')
    |                                               ^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:557:42-63: error:
    • Couldn't match expected type: Char -> CC s
                  with actual type: CC s
    • The function ‘CC’ is applied to three value arguments,
        but its type ‘s -> GHC.Int.Int64 -> CC s’ has only two
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0074' '\x0000')’
      In the expression: Yield '\x0073' (CC s '\x0074' '\x0000')
    • Relevant bindings include
        s :: s
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:557:22)
        foldMapping :: Char -> s -> Step (CC s) Char
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:327:1)
    |
557 | foldMapping '\xfb05' s = Yield '\x0073' (CC s '\x0074' '\x0000')
    |                                          ^^^^^^^^^^^^^^^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:557:47-54: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\x0074'’
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0074' '\x0000')’
      In the expression: Yield '\x0073' (CC s '\x0074' '\x0000')
    |
557 | foldMapping '\xfb05' s = Yield '\x0073' (CC s '\x0074' '\x0000')
    |                                               ^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:559:42-63: error:
    • Couldn't match expected type: Char -> CC s
                  with actual type: CC s
    • The function ‘CC’ is applied to three value arguments,
        but its type ‘s -> GHC.Int.Int64 -> CC s’ has only two
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0074' '\x0000')’
      In the expression: Yield '\x0073' (CC s '\x0074' '\x0000')
    • Relevant bindings include
        s :: s
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:559:22)
        foldMapping :: Char -> s -> Step (CC s) Char
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:327:1)
    |
559 | foldMapping '\xfb06' s = Yield '\x0073' (CC s '\x0074' '\x0000')
    |                                          ^^^^^^^^^^^^^^^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:559:47-54: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\x0074'’
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0074' '\x0000')’
      In the expression: Yield '\x0073' (CC s '\x0074' '\x0000')
    |
559 | foldMapping '\xfb06' s = Yield '\x0073' (CC s '\x0074' '\x0000')
    |                                               ^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:561:42-63: error:
    • Couldn't match expected type: Char -> CC s
                  with actual type: CC s
    • The function ‘CC’ is applied to three value arguments,
        but its type ‘s -> GHC.Int.Int64 -> CC s’ has only two
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0576' '\x0000')’
      In the expression: Yield '\x0574' (CC s '\x0576' '\x0000')
    • Relevant bindings include
        s :: s
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:561:22)
        foldMapping :: Char -> s -> Step (CC s) Char
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:327:1)
    |
561 | foldMapping '\xfb13' s = Yield '\x0574' (CC s '\x0576' '\x0000')
    |                                          ^^^^^^^^^^^^^^^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:561:47-54: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\x0576'’
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0576' '\x0000')’
      In the expression: Yield '\x0574' (CC s '\x0576' '\x0000')
    |
561 | foldMapping '\xfb13' s = Yield '\x0574' (CC s '\x0576' '\x0000')
    |                                               ^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:563:42-63: error:
    • Couldn't match expected type: Char -> CC s
                  with actual type: CC s
    • The function ‘CC’ is applied to three value arguments,
        but its type ‘s -> GHC.Int.Int64 -> CC s’ has only two
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0565' '\x0000')’
      In the expression: Yield '\x0574' (CC s '\x0565' '\x0000')
    • Relevant bindings include
        s :: s
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:563:22)
        foldMapping :: Char -> s -> Step (CC s) Char
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:327:1)
    |
563 | foldMapping '\xfb14' s = Yield '\x0574' (CC s '\x0565' '\x0000')
    |                                          ^^^^^^^^^^^^^^^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:563:47-54: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\x0565'’
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0565' '\x0000')’
      In the expression: Yield '\x0574' (CC s '\x0565' '\x0000')
    |
563 | foldMapping '\xfb14' s = Yield '\x0574' (CC s '\x0565' '\x0000')
    |                                               ^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:565:42-63: error:
    • Couldn't match expected type: Char -> CC s
                  with actual type: CC s
    • The function ‘CC’ is applied to three value arguments,
        but its type ‘s -> GHC.Int.Int64 -> CC s’ has only two
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x056b' '\x0000')’
      In the expression: Yield '\x0574' (CC s '\x056b' '\x0000')
    • Relevant bindings include
        s :: s
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:565:22)
        foldMapping :: Char -> s -> Step (CC s) Char
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:327:1)
    |
565 | foldMapping '\xfb15' s = Yield '\x0574' (CC s '\x056b' '\x0000')
    |                                          ^^^^^^^^^^^^^^^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:565:47-54: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\x056b'’
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x056b' '\x0000')’
      In the expression: Yield '\x0574' (CC s '\x056b' '\x0000')
    |
565 | foldMapping '\xfb15' s = Yield '\x0574' (CC s '\x056b' '\x0000')
    |                                               ^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:567:42-63: error:
    • Couldn't match expected type: Char -> CC s
                  with actual type: CC s
    • The function ‘CC’ is applied to three value arguments,
        but its type ‘s -> GHC.Int.Int64 -> CC s’ has only two
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0576' '\x0000')’
      In the expression: Yield '\x057e' (CC s '\x0576' '\x0000')
    • Relevant bindings include
        s :: s
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:567:22)
        foldMapping :: Char -> s -> Step (CC s) Char
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:327:1)
    |
567 | foldMapping '\xfb16' s = Yield '\x057e' (CC s '\x0576' '\x0000')
    |                                          ^^^^^^^^^^^^^^^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:567:47-54: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\x0576'’
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x0576' '\x0000')’
      In the expression: Yield '\x057e' (CC s '\x0576' '\x0000')
    |
567 | foldMapping '\xfb16' s = Yield '\x057e' (CC s '\x0576' '\x0000')
    |                                               ^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:569:42-63: error:
    • Couldn't match expected type: Char -> CC s
                  with actual type: CC s
    • The function ‘CC’ is applied to three value arguments,
        but its type ‘s -> GHC.Int.Int64 -> CC s’ has only two
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x056d' '\x0000')’
      In the expression: Yield '\x0574' (CC s '\x056d' '\x0000')
    • Relevant bindings include
        s :: s
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:569:22)
        foldMapping :: Char -> s -> Step (CC s) Char
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:327:1)
    |
569 | foldMapping '\xfb17' s = Yield '\x0574' (CC s '\x056d' '\x0000')
    |                                          ^^^^^^^^^^^^^^^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:569:47-54: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\x056d'’
      In the second argument of ‘Yield’, namely
        ‘(CC s '\x056d' '\x0000')’
      In the expression: Yield '\x0574' (CC s '\x056d' '\x0000')
    |
569 | foldMapping '\xfb17' s = Yield '\x0574' (CC s '\x056d' '\x0000')
    |                                               ^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:570:38-51: error:
    • Couldn't match expected type: Char -> CC s
                  with actual type: CC s
    • The function ‘CC’ is applied to three value arguments,
        but its type ‘s -> GHC.Int.Int64 -> CC s’ has only two
      In the second argument of ‘Yield’, namely ‘(CC s '\0' '\0')’
      In the expression: Yield (toLower c) (CC s '\0' '\0')
    • Relevant bindings include
        s :: s
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:570:15)
        foldMapping :: Char -> s -> Step (CC s) Char
          (bound at src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:327:1)
    |
570 | foldMapping c s = Yield (toLower c) (CC s '\0' '\0')
    |                                      ^^^^^^^^^^^^^^

src-ghc/Data/JSString/Internal/Fusion/CaseMapping.hs:570:43-46: error:
    • Couldn't match expected type ‘GHC.Int.Int64’
                  with actual type ‘Char’
    • In the second argument of ‘CC’, namely ‘'\0'’
      In the second argument of ‘Yield’, namely ‘(CC s '\0' '\0')’
      In the expression: Yield (toLower c) (CC s '\0' '\0')
    |
570 | foldMapping c s = Yield (toLower c) (CC s '\0' '\0')
    |                                           ^^^^
hamishmack commented 2 months ago

Is this still an issue with jsaddle 9.9.0?

hamishmack commented 2 months ago

I'm going to assume #136 fixed it.