- Expression simplified = new EApply(loc,
- new EConstant(loc, bindFunction, Types.canonical(monadType), Types.canonical(valueContentType), Types.canonical(inContentType)),
+ monadType = Types.canonical(monadType);
+ valueContentType = Types.canonical(valueContentType);
+ effect = Types.canonical(effect);
+ inContentType = Types.canonical(inContentType);
+ Type[] types = blockType == BlockType.MonadE
+ ? new Type[] {monadType, valueContentType, effect, inContentType}
+ : new Type[] {monadType, valueContentType, inContentType};
+ Expression simplified = new EApply(loc, effect,
+ new EConstant(loc, context.getValue(blockType == BlockType.MonadE ? Names.Prelude_bindE : Names.Prelude_bind), types),