@@ -1,6 +1,6 @@
11-- |
22-- This module implements the desugaring pass which replaces do-notation statements with
3−-- appropriate calls to bind from the Prelude.Monad type class.
3+-- appropriate calls to bind.
44--
55module Language.PureScript.Sugar.DoNotation (desugarDoModule) where
66
@@ -17,12 +17,16 @@ import Language.PureScript.Names
1717import qualified Language.PureScript.Constants as C
1818
1919-- |
20−-- Replace all @DoNotationBind@ and @DoNotationValue@ constructors with applications of the Prelude.bind function,
21−-- and all @DoNotationLet@ constructors with let expressions.
20+-- Replace all @DoNotationBind@ and @DoNotationValue@ constructors with
21+-- applications of the bind function in scope, and all @DoNotationLet@
22+-- constructors with let expressions.
2223--
2324desugarDoModule :: forall m. (MonadSupply m, MonadError MultipleErrors m) => Module -> m Module
2425desugarDoModule (Module ss coms mn ds exts) = Module ss coms mn <$> parU ds desugarDo <*> pure exts
2526
27+-- |
28+-- Desugar a single do statement
29+--
2630desugarDo :: forall m. (MonadSupply m, MonadError MultipleErrors m) => Declaration -> m Declaration
2731desugarDo (PositionedDeclaration pos com d) = PositionedDeclaration pos com <$> rethrowWithPosition pos (desugarDo d)
2832desugarDo d =