haskell-tree-sitter icon indicating copy to clipboard operation
haskell-tree-sitter copied to clipboard

Fix tree-sitter-haskell example

Open jorpic opened this issue 2 years ago • 0 comments

tree-sitter-haskell/examples/Demo.hs fails to compile with the following error:

    • Couldn't match expected type ‘Node -> TSPoint’
                  with actual type ‘TSPoint’
    • In the pattern: TSPoint {..}
      In a pattern binding: TSPoint {..} = nodeStartPoint
      In the expression:
        do theType <- peekCString nodeType
           let TSPoint {..} = nodeStartPoint
               start = "(" ++ show pointRow ++ "," ++ show pointColumn ++ ")"
           let TSPoint {..} = nodeEndPoint
               end = "(" ++ show pointRow ++ "," ++ show pointColumn ++ ")"
           print $ theType ++ start ++ "-" ++ end
   |
82 |   let TSPoint {..} = nodeStartPoint
   |       ^^^^^^^^^^^^

The problem is tat since 8ae40b366f9a615b58f2a171a801f6cd0fa12325 nodeStartPoint is not a field but a separate function and requires a Node as an argument.

jorpic avatar Jan 18 '23 09:01 jorpic