FSharpPlus


Const<'T,'U>

The Const functor, defined as Const<'T, 'U> where 'U is a phantom type. Useful for: Lens getters Its applicative instance plays a fundamental role in Lens.

Examples

#r @"nuget: FSharpPlus"
open FSharpPlus
open FSharpPlus.Lens
open FSharpPlus.Data
// note for instance the definition of view (from the Lens part of F#+):
let view (optic: ('a -> Const<_,'b>) -> _ -> Const<_,'t>) (source: 's) : 'a = Const.run (optic Const source)
namespace FSharpPlus
module Lens from FSharpPlus
<summary> Lens functions and operators </summary>
namespace FSharpPlus.Data
val view: optic: (('a -> Const<'a,'b>) -> 's -> Const<'a,'t>) -> source: 's -> 'a
val optic: (('a -> Const<'a,'b>) -> 's -> Const<'a,'t>)
'a
Multiple items
union case Const.Const: 't -> Const<'t,'u>

--------------------
module Const from FSharpPlus.Data
<summary> Basic operations on Const </summary>

--------------------
[<Struct>] type Const<'t,'u> = | Const of 't static member ( *> ) : Const<'C,'T> * Const<'C,'U> -> Const<'C,'U> (requires member ``+``) static member (+) : Const<'T,'U> * Const<'T,'U> -> Const<'T,'U> (requires member ``+``) static member (<!>) : ('T -> 'U) * Const<'C,'T> -> Const<'C,'U> static member ( <* ) : Const<'C,'U> * Const<'C,'T> -> Const<'C,'U> (requires member ``+``) static member (<*>) : Const<'C,('T -> 'U)> * Const<'C,'T> -> Const<'C,'U> (requires member ``+``) static member Bifold: Const<'T,'V> * f: ('U -> 'T -> 'U) * ('W -> 'V -> 'W) * z: 'U -> 'U static member BifoldBack: Const<'T,'V> * f: ('T -> 'U -> 'U) * ('V -> 'W -> 'W) * z: 'U -> 'U static member BifoldMap: Const<'T,'V> * f: ('T -> 'U) * ('V -> 'W) -> 'U static member Bimap: Const<'T,'V> * f: ('T -> 'U) * ('V -> 'W) -> Const<'U,'W> static member Bitraverse: Const<'T1,'U1> * f: ('T1 -> 'Functor<'T2>) * g: ('U1 -> 'Functor<'U2>) -> 'Functor<Const<'T2, 'U2>> (requires member Map and member Map and member Map) ...
<summary> The Const functor, defined as Const&lt;'T, 'U&gt; where 'U is a phantom type. Useful for: Lens getters Its applicative instance plays a fundamental role in Lens. <para /> Useful for: Lens getters. <para /> Its applicative instance plays a fundamental role in Lens. </summary>
'b
't
val source: 's
's
val run: Const<'f,'g> -> 'f