Skip to content

Slow compiler performance in Monad Transformers sample with Visual Studio, and can't give hints. #24

Open
@OnurGumus

Description

@OnurGumus

When I try Monad Tranformers sample with Visual Studio 2015 along with F# PowerTools, I noticed that the CPU peaks when IDE sits idle, probably due to type inference engine and syntax colorization is delayed for few seconds.

I am not sure if this issue is related to F# compiler , VisualFSharp or FSharpPlus. Can you suggest me any workarounds like putting a hint to make IDE happy for better performance ?
Also when I explicitly give type like below:

let getValidPassword : ErrorT<Async<_>> =
monad {
    let! s = liftAsync getLine
    if isValid s then return s
    else return! throw -1
}
</ catch /> (fun s -> throw ("The error was: " + decodeError s))

Notice Error<Async<_>>

`I get errors like below :

  • Could not resolve the ambiguity inherent in the use of the operator 'Bind' at or near this program point. Consider using type annotations to resolve the ambiguity.
  • Could not resolve the ambiguity inherent in the use of the operator 'LiftAsync' at or near this program point. Consider using type annotations to resolve the ambiguity.
  • Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'LiftAsync'. The available overloads are shown below (or in the Error List window). Consider adding further type constraints

Why is that so ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions