listing :: IParser (Comments -> Comments -> a) -> IParser (Var.Listing a)
listing explicit =
  expecting "a listing of values and types to expose, like (..)" $
  do  _ <- try (char '(')
      pushNewlineContext
      pre <- whitespace
      listing <-
          choice
            [ (\_ pre post _ -> (Var.OpenListing (Commented pre () post))) <$> string ".."
            , (\x pre post sawNewline ->
                (Var.ExplicitListing (x pre post) sawNewline))
                  <$> explicit
            ]
      post <- whitespace
      sawNewline <- popNewlineContext
      _ <- char ')'
      return $ listing pre post sawNewline
listing :: IParser (Comments -> Comments -> a) -> IParser (Var.Listing a)
listing explicit =
  expecting "a listing of values and types to expose, like (..)" $
  do  _ <- try (char '(')
      pushNewlineContext
      pre <- whitespace
      listing <-
          choice
            [ (\_ pre post _ -> (Var.OpenListing (Commented pre () post))) <$> string ".."
            , (\x pre post sawNewline ->
                (Var.ExplicitListing (x pre post) sawNewline))
                  <$> explicit
            ]
      post <- whitespace
      sawNewline <- popNewlineContext
      _ <- char ')'
      return $ listing pre post sawNewline
listing explicit =
  expecting "a listing of values and types to expose, like (..)" $
  do  _ <- try (char '(')
      pushNewlineContext
      pre <- whitespace
      listing <-
          choice
            [ (\_ pre post _ -> (Var.OpenListing (Commented pre () post))) <$> string ".."
            , (\x pre post sawNewline ->
                (Var.ExplicitListing (x pre post) sawNewline))
                  <$> explicit
            ]
      post <- whitespace
      sawNewline <- popNewlineContext
      _ <- char ')'
      return $ listing pre post sawNewline