diff --git a/src/FSharpPlus/Lens.fs b/src/FSharpPlus/Lens.fs index 18d442a9e..c95387cdb 100644 --- a/src/FSharpPlus/Lens.fs +++ b/src/FSharpPlus/Lens.fs @@ -52,7 +52,11 @@ module Lens = /// The prism. /// The object. /// The value (if any) the prism is targeting. + #if FABLE_COMPILER let preview (optic: ('a -> Const<_,'b>) -> _ -> Const<_,'t>) (source: 's) : 'a option = source |> optic (fun x -> Const (First (Some x))) |> Const.run |> First.run + #else + let preview prism = First.run << Const.run << prism (fun x -> Const (FSharpPlus.Data.First (Some x))) + #endif /// Build a 'Lens' from a getter and a setter. /// The lens should be assigned as an inline function of the free parameter, not a value, otherwise compiler will fail with a type constraint mismatch.