File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,10 @@ module ListT =
5858 loop l1 l2 : ListT< 'mt>
5959
6060 let inline bind f ( source : ListT < 'mt >) : ListT < 'mu > =
61- let _mnil _ = ( result Unchecked.defaultof< 't> : 'mt) >>= fun ( _ : 't ) -> ( result Unchecked.defaultof< 'u>) : 'mu
62- let rec loop f ( ListT input) =
61+ let _mnil = ( result Unchecked.defaultof< 't> : 'mt) >>= fun ( _ : 't ) -> ( result Unchecked.defaultof< 'u>) : 'mu
62+ let rec loop f input =
6363 ListT (
64- ( unbox input : 'mit) >>= function
64+ ( unwrap input : 'mit) >>= function
6565 | Nil -> result <| ( Nil : ListTNode< 'mu, 'u>) : 'miu
6666 | Cons ( h: 't, t: ListT< 'mt>) ->
6767 let res = concat ( f h: ListT< 'mu>) ( loop f t)
Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ module BasicTests =
2727 // Compile tests
2828 let binds () =
2929 let res1 = listT [| [ 1 .. 4 ] |] >>= fun x -> listT [| [ x * 2 ] |]
30- let res2 = listT ( Task.FromResult [ 1 .. 4 ]) |> ListT.bind ( fun x -> listT ( Task.FromResult [ x * 2 ]))
31- let res3 = listT ( ResizeArray [ [ 1 .. 4 ] ]) |> ListT.bind ( fun x -> listT ( ResizeArray [ [ x * 2 ] ]))
32- let res4 = listT ( lazy [ 1 .. 4 ]) |> ListT.bind ( fun x -> listT ( lazy ( [ x * 2 ])))
33- let ( res5 : ListT < _ seq >) = listT ( seq [ [ 1 .. 4 ] ]) |> ListT.bind ( fun x -> listT ( seq [ [ x * 2 ] ]))
34- () // Note: seq needs type annotation, the non-sealead types don't work with generic >>= (internal error, unsolved type var)
30+ let res2 = listT ( Task.FromResult [ 1 .. 4 ]) >>= ( fun x -> listT ( Task.FromResult [ x * 2 ]))
31+ let res3 = listT ( ResizeArray [ [ 1 .. 4 ] ]) >>= ( fun x -> listT ( ResizeArray [ [ x * 2 ] ]))
32+ let res4 = listT ( lazy [ 1 .. 4 ]) >>= ( fun x -> listT ( lazy ( [ x * 2 ])))
33+ let ( res5 : ListT < _ seq >) = listT ( seq [ [ 1 .. 4 ] ]) >>= ( fun x -> listT ( seq [ [ x * 2 ] ]))
34+ () // Note: seq needs type annotation.
3535
3636 let bind_for_ideantity () =
3737 let res = listT ( Identity [ 1 .. 4 ]) >>= fun x -> listT ( Identity [ x * 2 ])
You can’t perform that action at this time.
0 commit comments