Skip to content

Commit

Permalink
Require Ord instead of Eq
Browse files Browse the repository at this point in the history
Not used yet, but will be soon
  • Loading branch information
tomjaguarpaw committed Dec 10, 2023
1 parent ddcd461 commit fe0dc71
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Stan/Hie.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This function needs to take the original 'HieFile' because constants
are not stored in 'HieAST' and to compare constants we need to compare
parts of source code.
-}
eqAst :: forall a . Eq a => HieFile -> HieAST a -> HieAST a -> Bool
eqAst :: forall a . Ord a => HieFile -> HieAST a -> HieAST a -> Bool
eqAst HieFile{..} = eqNodes
where
eqNodes :: HieAST a -> HieAST a -> Bool
Expand Down
2 changes: 1 addition & 1 deletion src/Stan/Hie/Compat900.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import Text.Show (show)
-- 2. return a NodeInfo with empty fields when the SourceInfo is empty
--
-- It works though.
nodeInfo :: HieAST a -> NodeInfo a
nodeInfo :: Ord a => HieAST a -> NodeInfo a
nodeInfo h = case (lookup' SourceInfo, lookup' GeneratedInfo) of
(Nothing, Nothing) -> error "nodeInfo"
(Just n1, Nothing) -> n1
Expand Down
2 changes: 1 addition & 1 deletion src/Stan/Hie/Compat902.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import Text.Show (show)
-- 2. return a NodeInfo with empty fields when the SourceInfo is empty
--
-- It works though.
nodeInfo :: HieAST a -> NodeInfo a
nodeInfo :: Ord a => HieAST a -> NodeInfo a
nodeInfo h = case (lookup' SourceInfo, lookup' GeneratedInfo) of
(Nothing, Nothing) -> error "nodeInfo"
(Just n1, Nothing) -> n1
Expand Down
2 changes: 1 addition & 1 deletion src/Stan/Hie/Compat904.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import Text.Show (show)
-- 2. return a NodeInfo with empty fields when the SourceInfo is empty
--
-- It works though.
nodeInfo :: HieAST a -> NodeInfo a
nodeInfo :: Ord a => HieAST a -> NodeInfo a
nodeInfo h = case (lookup' SourceInfo, lookup' GeneratedInfo) of
(Nothing, Nothing) -> error "nodeInfo"
(Just n1, Nothing) -> n1
Expand Down

0 comments on commit fe0dc71

Please sign in to comment.