Skip to content

Commit efcfd89

Browse files
committed
Hide stuff in SeqT
1 parent 63acdb7 commit efcfd89

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

src/FSharpPlus/Data/Seq.fs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ module SeqT =
6060

6161
type SeqT<'``monad<seq<'t>>``> with
6262

63+
[<EditorBrowsable(EditorBrowsableState.Never)>]
6364
static member inline Return (x: 'T) = x |> Seq.singleton |> result |> SeqT : SeqT<'``Monad<seq<'T>``>
6465

6566
[<EditorBrowsable(EditorBrowsableState.Never)>]
@@ -71,31 +72,55 @@ type SeqT<'``monad<seq<'t>>``> with
7172
[<EditorBrowsable(EditorBrowsableState.Never)>]
7273
static member inline Lift3 (f: 'T->'U->'V->'W, x: SeqT<'``Monad<seq<'T>``>, y: SeqT<'``Monad<seq<'U>``>, z: SeqT<'``Monad<seq<'V>``>) = SeqT.lift3 f x y z : SeqT<'``Monad<seq<'W>``>
7374

75+
[<EditorBrowsable(EditorBrowsableState.Never)>]
7476
static member inline (<*>) (f: SeqT<'``Monad<seq<('T -> 'U)>``>, x: SeqT<'``Monad<seq<'T>``>) = SeqT.apply f x : SeqT<'``Monad<seq<'U>``>
77+
78+
[<EditorBrowsable(EditorBrowsableState.Never)>]
7579
static member inline (>>=) (x: SeqT<'``Monad<seq<'T>``>, f: 'T -> SeqT<'``Monad<seq<'U>``>) = SeqT.bind f x
7680

81+
[<EditorBrowsable(EditorBrowsableState.Never)>]
7782
static member inline get_Empty () = SeqT <| result Seq.empty : SeqT<'``MonadPlus<seq<'T>``>
83+
84+
[<EditorBrowsable(EditorBrowsableState.Never)>]
7885
static member inline (<|>) (SeqT x, SeqT y) = SeqT <| (x >>= (fun a -> y >>= (fun b -> result ((Seq.append:seq<_>->seq<_>->_) a b)))) : SeqT<'``MonadPlus<seq<'T>``>
7986

87+
[<EditorBrowsable(EditorBrowsableState.Never)>]
8088
static member inline TryWith (source: SeqT<'``Monad<seq<'T>>``>, f: exn -> SeqT<'``Monad<seq<'T>>``>) = SeqT (TryWith.Invoke (SeqT.run source) (SeqT.run << f))
89+
90+
[<EditorBrowsable(EditorBrowsableState.Never)>]
8191
static member inline TryFinally (computation: SeqT<'``Monad<seq<'T>>``>, f) = SeqT (TryFinally.Invoke (SeqT.run computation) f)
92+
93+
[<EditorBrowsable(EditorBrowsableState.Never)>]
8294
static member inline Using (resource, f: _ -> SeqT<'``Monad<seq<'T>>``>) = SeqT (Using.Invoke resource (SeqT.run << f))
95+
96+
[<EditorBrowsable(EditorBrowsableState.Never)>]
8397
static member inline Delay (body : unit -> SeqT<'``Monad<seq<'T>>``>) = SeqT (Delay.Invoke (fun _ -> SeqT.run (body ()))) : SeqT<'``Monad<seq<'T>>``>
8498

8599
[<EditorBrowsable(EditorBrowsableState.Never)>]
86100
static member inline Lift (x: '``Monad<'T>``) : SeqT<'``Monad<seq<'T>>``> = SeqT.lift x
87101

102+
[<EditorBrowsable(EditorBrowsableState.Never)>]
88103
static member inline LiftAsync (x: Async<'T>) = SeqT.lift (liftAsync x) : SeqT<'``MonadAsync<'T>``>
89104

105+
[<EditorBrowsable(EditorBrowsableState.Never)>]
90106
static member inline Throw (x: 'E) = x |> throw |> SeqT.lift
107+
108+
[<EditorBrowsable(EditorBrowsableState.Never)>]
91109
static member inline Catch (m: SeqT<'``MonadError<'E1,'T>``>, h: 'E1 -> SeqT<'``MonadError<'E2,'T>``>) = SeqT ((fun v h -> catch v h) (SeqT.run m) (SeqT.run << h)) : SeqT<'``MonadError<'E2,'T>``>
92110

111+
[<EditorBrowsable(EditorBrowsableState.Never)>]
93112
static member inline CallCC (f: (('T -> SeqT<'``MonadCont<'R,seq<'U>>``>) -> _)) = SeqT (callCC <| fun c -> SeqT.run (f (SeqT << c << Seq.singleton ))) : SeqT<'``MonadCont<'R, seq<'T>>``>
94113

114+
[<EditorBrowsable(EditorBrowsableState.Never)>]
95115
static member inline get_Get () = SeqT.lift get : SeqT<'``MonadState<'S,'S>``>
116+
117+
[<EditorBrowsable(EditorBrowsableState.Never)>]
96118
static member inline Put (x: 'S) = x |> put |> SeqT.lift : SeqT<'``MonadState<unit,'S>``>
97119

120+
[<EditorBrowsable(EditorBrowsableState.Never)>]
98121
static member inline get_Ask () = SeqT.lift ask : SeqT<'``MonadReader<'R,seq<'R>>``>
122+
123+
[<EditorBrowsable(EditorBrowsableState.Never)>]
99124
static member inline Local (SeqT (m: '``MonadReader<'R2,'T>``), f: 'R1->'R2) = SeqT (local f m)
100125

101126
// END old SeqT code
@@ -1054,8 +1079,12 @@ module [<AutoOpen>]SeqTOperations =
10541079

10551080
type SeqT<'``monad<bool>``, 'T> with
10561081

1082+
[<EditorBrowsable(EditorBrowsableState.Never)>]
10571083
static member inline Return (x: 'T) : SeqT<'``Monad<bool>``, 'T> = SeqT.singleton x
1084+
1085+
[<EditorBrowsable(EditorBrowsableState.Never)>]
10581086
static member inline Map (x: SeqT<'``Monad<bool>``, 'T>, f: 'T -> 'U) : SeqT<'``Monad<bool>``, 'U> = SeqT.map f x
1087+
10591088
static member inline (<!>) (x: SeqT<'``Monad<bool>``, 'T>, f: 'T -> 'U) : SeqT<'``Monad<bool>``, 'U> = SeqT.map f x
10601089
static member inline (<*>) (f: SeqT<'``Monad<bool>``, ('T -> 'U)>, x: SeqT<'``Monad<bool>``, 'T>) : SeqT<'``Monad<bool>``, 'U> = SeqT.apply f x
10611090

@@ -1078,7 +1107,10 @@ type SeqT<'``monad<bool>``, 'T> with
10781107
((fun (k: 'U) (_: 'T) -> k) <!> x: SeqT<'``Monad<bool>``, ('T -> 'U)>) <*> y
10791108

10801109
static member inline (>>=) (x: SeqT<'``Monad<bool>``, 'T>, f: 'T -> SeqT<'``Monad<bool>``, 'U>) : SeqT<'``Monad<bool>``, 'U> = SeqT.collect f x
1110+
1111+
[<EditorBrowsable(EditorBrowsableState.Never)>]
10811112
static member inline get_Empty () : SeqT<'``Monad<bool>``, 'T> = SeqT.empty
1113+
10821114
static member inline (<|>) (x, y) : SeqT<'``Monad<bool>``, 'T> = SeqT.append x y
10831115

10841116
[<EditorBrowsable(EditorBrowsableState.Never)>]
@@ -1087,31 +1119,49 @@ type SeqT<'``monad<bool>``, 'T> with
10871119
[<EditorBrowsable(EditorBrowsableState.Never)>]
10881120
static member inline Lift3 (f: 'T1 -> 'T2 -> 'T3 -> 'U, x1: SeqT<'``Monad<bool>``, 'T1>, x2: SeqT<'``Monad<bool>``, 'T2>, x3: SeqT<'``Monad<bool>``, 'T3>) : SeqT<'``Monad<bool>``, 'U> = SeqT.lift3 f x1 x2 x3
10891121

1122+
[<EditorBrowsable(EditorBrowsableState.Never)>]
10901123
static member inline TryWith (source: SeqT<'``Monad<bool>``, 'T>, f: exn -> SeqT<'``Monad<bool>``, 'T>) = SeqT.tryWith<_, _, '``Monad<unit>``> source f
1124+
1125+
[<EditorBrowsable(EditorBrowsableState.Never)>]
10911126
static member inline TryFinally (computation: SeqT<'``Monad<bool>``, 'T>, f) = SeqT.tryFinally computation f
1127+
1128+
[<EditorBrowsable(EditorBrowsableState.Never)>]
10921129
static member inline Delay (body: unit -> SeqT<'``Monad<bool>``, 'T>) : SeqT<'``Monad<bool>``, 'T> = SeqT.delay body
1130+
1131+
[<EditorBrowsable(EditorBrowsableState.Never)>]
10931132
static member inline Using (resource, f: _ -> SeqT<'``Monad<bool>``, 'T>) =
10941133
SeqT.tryFinally (f resource) (fun () -> if box resource <> null then dispose resource)
10951134

10961135
[<EditorBrowsable(EditorBrowsableState.Never)>]
10971136
static member inline Lift (m: '``Monad<'T>``) : SeqT<'``Monad<bool>``, 'T> = SeqT.lift m
10981137

1138+
[<EditorBrowsable(EditorBrowsableState.Never)>]
10991139
static member inline LiftAsync (x: Async<'T>) = SeqT.lift (liftAsync x: '``MonadAsync<'T>``) : SeqT<'MonadAsync, 'T>
11001140

1141+
[<EditorBrowsable(EditorBrowsableState.Never)>]
11011142
static member inline Throw (x: 'E) : SeqT<'``MonadError<'E>``, 'T> = x |> throw |> SeqT.lift
1143+
1144+
[<EditorBrowsable(EditorBrowsableState.Never)>]
11021145
static member inline Catch (m: SeqT<'``MonadError<'E1>``, 'T>, h: 'E1 -> SeqT<'``MonadError<'E2>``, 'T>) : SeqT<'``MonadError<'E2>``, 'T> =
11031146
seqT (
11041147
(fun v h -> Catch.Invoke v h)
11051148
(SeqT.run m)
11061149
(SeqT.run << h))
11071150

1151+
[<EditorBrowsable(EditorBrowsableState.Never)>]
11081152
static member inline CallCC (f: (('T -> SeqT<'``MonadCont<'R>``, 'U>) -> _)) : SeqT<'``MonadCont<'R>``, 'T> =
11091153
seqT (callCC <| fun c -> SeqT.run (f (seqT << c << Seq.singleton)))
11101154

1155+
[<EditorBrowsable(EditorBrowsableState.Never)>]
11111156
static member inline get_Get () : SeqT<'``MonadState<'S>``, 'S> = SeqT.lift get
1157+
1158+
[<EditorBrowsable(EditorBrowsableState.Never)>]
11121159
static member inline Put (x: 'T) : SeqT<'``MonadState<unit>``, 'S> = x |> put |> SeqT.lift
11131160

1161+
[<EditorBrowsable(EditorBrowsableState.Never)>]
11141162
static member inline get_Ask () : SeqT<'``MonadReader<'R>``, 'R> = SeqT.lift ask
1163+
1164+
[<EditorBrowsable(EditorBrowsableState.Never)>]
11151165
static member inline Local (m: SeqT<'``MonadReader<'R2>``, 'T>, f: 'R1 -> 'R2) : SeqT<'``MonadReader<'R1>``, 'T> =
11161166
seqT (local f (SeqT.run m))
11171167

0 commit comments

Comments
 (0)