1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Derive an instance of Ix for Diagonal.

This commit is contained in:
Rob Rix 2017-03-23 15:54:46 -04:00
parent 6ca3d56269
commit 973d873297

View File

@ -19,7 +19,7 @@ module SES.Myers
import Control.Exception
import Control.Monad.Free.Freer
import qualified Data.Array as Array
import Data.Ix (inRange)
import Data.Ix
import Data.Functor.Classes
import Data.String
import Data.These
@ -68,7 +68,7 @@ newtype Distance = Distance { unDistance :: Int }
-- | A diagonal in the edit graph of lists of lengths n and m, numbered from -m to n.
newtype Diagonal = Diagonal { unDiagonal :: Int }
deriving (Eq, Ord, Show)
deriving (Eq, Ix, Ord, Show)
-- | The endpoint of a path through the edit graph, represented as the x/y indices and the script of edits made to get to that point.
data Endpoint a b = Endpoint { x :: !Int, y :: !Int, script :: !(EditScript a b) }