diff --git a/src/Language/Haskell/Exts/Location.hs b/src/Language/Haskell/Exts/Location.hs index 914e941d..56050b50 100644 --- a/src/Language/Haskell/Exts/Location.hs +++ b/src/Language/Haskell/Exts/Location.hs @@ -14,11 +14,11 @@ import Language.Haskell.Exts.Syntax -- -- The location only indicates the beginning of a range, because that's what -- haskell-src-exts provides. -type Located a = Writer (Option (Min SrcLoc)) a +type Located a = Writer (Maybe (Min SrcLoc)) a located :: SrcLoc -> Located () -located srcLoc | srcLoc == noLoc = tell $ Option $ Nothing - | otherwise = tell $ Option $ Just $ Min srcLoc +located srcLoc | srcLoc == noLoc = tell $ Nothing + | otherwise = tell $ Just $ Min srcLoc annotated :: (Annotated ast, SrcInfo si) => ast si -> Located (ast si) annotated x = do @@ -28,4 +28,4 @@ annotated x = do runLocated :: Located a -> (a, Maybe SrcLoc) runLocated = go . runWriter where - go (x, p) = (x, fmap getMin $ getOption $ p) + go (x, p) = (x, fmap getMin $ p)