Skip to content

Map is still available at a breakpoint where Map should not be in scope #299

Description

@alt-romes

Consider:

module Main where

import Data.List (sort, nub)
import qualified Data.Map.Strict as Map
import Other (process)

main :: IO ()
main = do
  let xs = [3, 1, 4, 1, 5, 9, 2, 6] :: [Int]
  let m = Map.fromList [("a", 1), ("b", 2)] :: Map.Map String Int
  check xs m
  process xs

check :: [Int] -> Map.Map String Int -> IO ()
check xs m = do
  print xs
  print m
module Other where

process :: [Int] -> IO ()
process xs = do
  let n = length xs
  print n

Stop at the call to process in Main.hs, line 15. Map is in scope, so evaluating Map.fromList [...] at the REPL should succeed.

Then, run until you stop at a second breakpoint inside the definition of process, say line 4 (call to print). Evaluating Map.fromList at the REPL now shouldn't work (because Map is no longer in scope), but it does.

What do we make of that behavior? I'm not sure if that's expected.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions