Skip to content

F# Regressions affecting F#+ #613

Open
@gusty

Description

@gusty

With the release of F# 9, lot of regressions are being observed.

The idea is to compile a list as much detailed as possible.

  • F#+ doesn't compiler anymore:

    • Errors in Extensions/Observable.fs and Extensions/AsyncEnumerable.fs related to SeqT.lisft see below more examples of this error.
  • F#+ examples broken:

    • CEs:

      let (asnNumber: Async<_>) = monad.fx {
      let mutable m = ResizeArray ()
      try
      for i = 1 to 10 do
      m.Add i
      return m.[-1]
      with e ->
      return -3 }

      Fails both when using F#+ nuget and when using F#+ compiled with F#9.
      More information: The for method of the monad.fx builder is compiled as follow:

      in F#9 comp F#+ ==> Monad<unit> For$W[a,T,Monad<unit>](FSharpFunc`2[FSharpFunc`2[Unit,Monad<unit>],Monad<unit>], FSharpFunc`2[Delay,FSharpFunc`2[FSharpFunc`2[Unit,Monad<unit>],FSharpFunc`2[Delay,Monad<unit>]]], FSharpFunc`2[Monad<unit>,FSharpFunc`2[Return,FSharpFunc`2[Unit,Monad<unit>]]], FSharpFunc`2[IDisposable,FSharpFunc`2[FSharpFunc`2[IDisposable,Monad<unit>],FSharpFunc`2[Using,Monad<unit>]]], FSharpFunc`2[Monad<unit>,FSharpFunc`2[FSharpFunc`2[Unit,Monad<unit>],Monad<unit>]], a, FSharpFunc`2[T,Monad<unit>])|];
      
      in existing F#+ ==> Monad<unit> For$W[a,T,Monad<unit>](FSharpFunc`2                                                          [Delay,FSharpFunc`2[FSharpFunc`2[Unit,Monad<unit>],FSharpFunc`2[Delay,Monad<unit>]]], FSharpFunc`2[Monad<unit>,FSharpFunc`2[Return,FSharpFunc`2[Unit,Monad<unit>]]], FSharpFunc`2[IDisposable,FSharpFunc`2[FSharpFunc`2[IDisposable,Monad<unit>],FSharpFunc`2[Using,Monad<unit>]]], FSharpFunc`2[Monad<unit>,FSharpFunc`2[FSharpFunc`2[Unit,Monad<unit>],Monad<unit>]], a, FSharpFunc`2[T,Monad<unit>])|];
      
    • SeqT:

      let pages: SeqT<_, _> = monad.plus {
      use wc = new WebClient ()
      for url in urls do
      try
      let! html = wc.AsyncDownloadString (Uri url) |> SeqT.lift
      yield url, html.Length
      with _ ->
      yield url, -1 }

      Fails with `type-seqt.fsx(74,61): error FS0001: 'SeqT_V2.SeqT.lift' does not support the type 'Async', because the latter lacks the required (real or built-in) member 'Map'``

      Same failure in

      let! doc = downloadDocument url |> SeqT.lift

    • Alternatives:

      • let firstGood = choice alternatives //Some "Result is OK"

        Using F#+ compiled with F#9 -> abstraction-alternative.fsx(114,24): error FS0001: The type 'string option list' does not support the operator 'choice'
      • let nameAndAddress = traverse (fun x -> putStrLn x >>= fun _ -> getLine) ["name";"address"]

        abstraction-alternative.fsx(128,22): error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. None of the types 'Async<(string list -> string list)>, obj' support the operator '<*>' Consider adding further type constraints
    • Bitraversable:

      let res42 = asyncSquareRoot 1764 |> bisequence |> Async.RunSynchronously
      abstraction-bitraversable.fsx(87,37): error FS0043: No overloads match for method 'Bisequence'.

    • Misc:

      let firstOk = choice resultList

      abstraction-misc.fsx(47,22): error FS0001: '.Choice' does not support the type 'Result<int,string>', because the latter lacks the required (real or built-in) member 'IsAltLeftZero' (seems to be the same as the one in Alternatives.

    • Monad:

      (same as above)
      abstraction-monad.fsx(346,16): error FS0001: The type ''a list' does not support the operator 'choice'

    • Profunctor:

      let res210 = traverse f [1; 2; 3]
      let resSome210 = traverse g [1; 2; 3]
      let resEmptyList = traverse f [1000; 2000; 3000]
      let resEListOfElist = traverse f []

    • Traversable:

      let res210 = traverse f [1; 2; 3]
      let resSome210 = traverse g [1; 2; 3]
      let resEmptyList = traverse f [1000; 2000; 3000]
      let resEListOfElist = traverse f []

      abstraction-traversable.fsx(110,23): error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. None of the types '(int list -> int list) list, obj' support the operator '<*>' Consider adding further type constraints

      abstraction-traversable.fsx(111,23): error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. None of the types '(int list -> int list) option, obj' support the operator '<*>' Consider adding further type constraints

      abstraction-traversable.fsx(112,23): error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. None of the types '(int list -> int list) list, obj' support the operator '<*>' Consider adding further type constraints

      abstraction-traversable.fsx(113,23): error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. None of the types '(int list -> int list) list, obj' support the operator '<*>' Consider adding further type constraints

    • ZipApplicative:

      let (x, y) = zip (async { return 1 }) (async { return '2' }) |> Async.RunSynchronously

      abstraction-zipapplicative.fsx(139,65): error FS0193: None of the types 'Async<int>, Async<char>, Async<'a>' support the operator 'Zip'

Testing is not complete. More errors are expected in Tests and maybe in the TypeLevel project

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions