Skip to content

Commit 6a87152

Browse files
JBgusty
authored andcommitted
Removing Net35 directives (#202)
1 parent 5a9d194 commit 6a87152

File tree

4 files changed

+0
-62
lines changed

4 files changed

+0
-62
lines changed

src/FSharpPlus/Converter.fs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,11 @@ type Parse =
114114
inherit Default1
115115
static member inline Parse (_: ^R , _: Default1) = fun (x:string) -> (^R: (static member Parse : _ -> ^R) x)
116116
static member inline Parse (_: ^R , _: Parse ) = fun (x:string) -> (^R: (static member Parse : _ * _ -> ^R) (x, CultureInfo.InvariantCulture))
117-
#if NET35
118-
#else
119117
static member Parse (_: 'T when 'T : enum<_>, _: Parse ) = fun x ->
120118
(match Enum.TryParse (x) with
121119
| (true, v) -> v
122120
| _ -> invalidArg "value" ("Requested value '" + x + "' was not found.")
123121
) : 'enum
124-
#endif
125122
static member Parse (_: bool , _: Parse) = fun x -> Boolean.Parse (x)
126123
static member Parse (_: char , _: Parse) = fun x -> Char .Parse (x)
127124
static member Parse (_: string , _: Parse) = id : string->_

src/FSharpPlus/Functor.fs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ open System.Runtime.CompilerServices
55
open System.Runtime.InteropServices
66
open System.Text
77
open System.Collections.Generic
8-
#if NET35
9-
#else
108
open System.Threading.Tasks
11-
#endif
129
open Microsoft.FSharp.Quotations
1310

1411
open FSharpPlus.Internals
@@ -21,10 +18,7 @@ open FSharpPlus
2118
type Bind =
2219
static member (>>=) (source: Lazy<'T> , f: 'T -> Lazy<'U> ) = lazy (f source.Value).Value : Lazy<'U>
2320
static member (>>=) (source: seq<'T> , f: 'T -> seq<'U> ) = Seq.bind f source : seq<'U>
24-
#if NET35
25-
#else
2621
static member (>>=) (source: Task<'T> , f: 'T -> Task<'U> ) = source.ContinueWith(fun (x: Task<_>) -> f x.Result).Unwrap () : Task<'U>
27-
#endif
2822
static member (>>=) (source , f: 'T -> _ ) = Option.bind f source : option<'U>
2923
static member (>>=) (source , f: 'T -> _ ) = List.collect f source : list<'U>
3024
static member (>>=) (source , f: 'T -> _ ) = Array.collect f source : 'U []
@@ -65,10 +59,7 @@ type Join =
6559
static member Join (x: Lazy<Lazy<_>> , [<Optional>]_output: Lazy<'T> , [<Optional>]_mthd: Join ) = lazy x.Value.Value : Lazy<'T>
6660
static member Join (x: seq<seq<_>> , [<Optional>]_output: seq<'T> , [<Optional>]_mthd: Join ) = Seq.concat x : seq<'T>
6761
static member Join (x: Id<_> , [<Optional>]_output: Id<'T> , [<Optional>]_mthd: Join ) = x.getValue : Id<'T>
68-
#if NET35
69-
#else
7062
static member Join (x: Task<Task<_>> , [<Optional>]_output: Task<'T> , [<Optional>]_mthd: Join ) = Task.join x : Task<'T>
71-
#endif
7263
static member Join (x , [<Optional>]_output: option<'T> , [<Optional>]_mthd: Join ) = Option.flatten x : option<'T>
7364
static member Join (x: list<list<_>> , [<Optional>]_output: list<'T> , [<Optional>]_mthd: Join ) = List.concat x : list<'T>
7465
static member Join (x: _ [][] , [<Optional>]_output: 'T [] , [<Optional>]_mthd: Join ) = Array.concat x : 'T []
@@ -114,13 +105,10 @@ type Return =
114105
static member inline Return (_: 'R , _: Default1) = fun (x: 'T) -> Return.InvokeOnInstance x : 'R
115106

116107
static member Return (_: Lazy<'a> , _: Return ) = fun x -> Lazy<_>.CreateFromValue x : Lazy<'a>
117-
#if NET35
118-
#else
119108
static member Return (_: 'a Task , _: Return ) = fun x ->
120109
let s = TaskCompletionSource ()
121110
s.SetResult x
122111
s.Task : 'a Task
123-
#endif
124112
static member Return (_: option<'a> , _: Return ) = fun x -> Some x : option<'a>
125113
static member Return (_: list<'a> , _: Return ) = fun x -> [ x ] : list<'a>
126114
static member Return (_: 'a [] , _: Return ) = fun x -> [|x|] : 'a []
@@ -222,10 +210,7 @@ type Map =
222210
inherit Default1
223211

224212
static member Map ((x: Lazy<_> , f: 'T->'U), _mthd: Map) = Lazy<_>.Create (fun () -> f x.Value) : Lazy<'U>
225-
#if NET35
226-
#else
227213
static member Map ((x: Task<'T> , f: 'T->'U), _mthd: Map) = Task.map f x : Task<'U>
228-
#endif
229214
static member Map ((x: option<_> , f: 'T->'U), _mthd: Map) = Option.map f x
230215
static member Map ((x: list<_> , f: 'T->'U), _mthd: Map) = List.map f x : list<'U>
231216
static member Map ((g: 'R->'T , f: 'T->'U), _mthd: Map) = (>>) g f
@@ -439,10 +424,7 @@ type Extract =
439424
static member inline Extract (f: 'Monoid -> 'T) = f (Zero.Invoke ())
440425
static member Extract (f: 'T Id ) = f
441426

442-
#if NET35
443-
#else
444427
static member Extract (f: Task<'T> ) = f.Result
445-
#endif
446428

447429
static member inline Invoke (x: '``Comonad<'T>``) : 'T =
448430
let inline call_2 (_mthd: ^M, x: ^I) = ((^M or ^I) : (static member Extract : _ -> _) x)
@@ -455,10 +437,7 @@ type Extend =
455437
static member inline (=>>) (g: 'Monoid -> 'T, f: _ -> 'U ) = fun a -> f (fun b -> g (Plus.Invoke a b))
456438
static member (=>>) (g: Id<'T> , f: Id<'T> -> 'U ) = f g
457439

458-
#if NET35
459-
#else
460440
static member (=>>) (g: Task<'T> , f: Task<'T> -> 'U) = g.ContinueWith (f)
461-
#endif
462441

463442
// Restricted Comonads
464443
static member (=>>) (s: list<'T> , g) = List.map g (List.tails s) : list<'U>

src/FSharpPlus/Monoid.fs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ open System.Collections.Generic
66
open System.Runtime.CompilerServices
77
open System.Runtime.InteropServices
88
open Microsoft.FSharp.Quotations
9-
#if NET35
10-
#else
119
open System.Threading.Tasks
12-
#endif
1310
open FSharpPlus
1411
open FSharpPlus.Internals
1512
open FSharpPlus.Internals.Prelude
@@ -83,14 +80,11 @@ type Plus with
8380

8481
type Plus with
8582

86-
#if NET35
87-
#else
8883
static member inline ``+`` (x: 'a Task, y: 'a Task, [<Optional>]_mthd: Plus) =
8984
x.ContinueWith(fun (t: Task<_>) ->
9085
(fun a ->
9186
y.ContinueWith(fun (u: Task<_>) ->
9287
Plus.Invoke a u.Result)) t.Result).Unwrap ()
93-
#endif
9488

9589
static member inline ``+`` (x: Map<'a,'b> , y , [<Optional>]_mthd: Plus) = Map.unionWith Plus.Invoke x y
9690

src/FSharpPlus/Numeric.fs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ type FromBigInt =
2222
static member FromBigInt (_: unativeint, _: FromBigInt) = fun (x: bigint) -> unativeint (int x)
2323
static member FromBigInt (_: bigint , _: FromBigInt) = fun (x: bigint) -> x
2424
static member FromBigInt (_: float , _: FromBigInt) = fun (x: bigint) -> float x
25-
#if NET35
26-
static member FromBigInt (_: sbyte , _: FromBigInt) = fun (x: bigint) -> sbyte (int x)
27-
static member FromBigInt (_: int16 , _: FromBigInt) = fun (x: bigint) -> int16 (int x)
28-
static member FromBigInt (_: byte , _: FromBigInt) = fun (x: bigint) -> byte (int x)
29-
static member FromBigInt (_: uint16 , _: FromBigInt) = fun (x: bigint) -> uint16 (int x)
30-
static member FromBigInt (_: uint32 , _: FromBigInt) = fun (x: bigint) -> uint32 (int x)
31-
static member FromBigInt (_: uint64 , _: FromBigInt) = fun (x: bigint) -> uint64 (int64 x)
32-
static member FromBigInt (_: float32 , _: FromBigInt) = fun (x: bigint) -> float32 (int x)
33-
static member FromBigInt (_: decimal , _: FromBigInt) = fun (x: bigint) -> decimal (int x)
34-
#else
3525
static member FromBigInt (_: sbyte , _: FromBigInt) = fun (x: bigint) -> sbyte x
3626
static member FromBigInt (_: int16 , _: FromBigInt) = fun (x: bigint) -> int16 x
3727
static member FromBigInt (_: byte , _: FromBigInt) = fun (x: bigint) -> byte x
@@ -40,7 +30,6 @@ type FromBigInt =
4030
static member FromBigInt (_: uint64 , _: FromBigInt) = fun (x: bigint) -> uint64 x
4131
static member FromBigInt (_: float32 , _: FromBigInt) = fun (x: bigint) -> float32 x
4232
static member FromBigInt (_: decimal , _: FromBigInt) = fun (x: bigint) -> decimal x
43-
#endif
4433

4534
static member inline Invoke (x: bigint) : 'Num =
4635
let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member FromBigInt : _*_ -> _) b, a)
@@ -60,23 +49,13 @@ type FromInt64 =
6049
static member FromInt64 (_: unativeint, _: FromInt64) = fun (x: int64) -> unativeint (int x)
6150
static member FromInt64 (_: bigint , _: FromInt64) = fun (x: int64) -> bigint x
6251
static member FromInt64 (_: float , _: FromInt64) = fun (x: int64) -> float x
63-
#if NET35
64-
static member FromInt64 (_: float32 , _: FromInt64) = fun (x: int64) -> float32 (int x)
65-
static member FromInt64 (_: decimal , _: FromInt64) = fun (x: int64) -> decimal (int x)
66-
static member FromInt64 (_: sbyte , _: FromInt64) = fun (x: int64) -> sbyte (int x)
67-
static member FromInt64 (_: int16 , _: FromInt64) = fun (x: int64) -> int16 (int x)
68-
static member FromInt64 (_: byte , _: FromInt64) = fun (x: int64) -> byte (int x)
69-
static member FromInt64 (_: uint16 , _: FromInt64) = fun (x: int64) -> uint16 (int x)
70-
static member FromInt64 (_: uint32 , _: FromInt64) = fun (x: int64) -> uint32 (int x)
71-
#else
7252
static member FromInt64 (_: float32 , _: FromInt64) = fun (x: int64) -> float32 x
7353
static member FromInt64 (_: decimal , _: FromInt64) = fun (x: int64) -> decimal x
7454
static member FromInt64 (_: sbyte , _: FromInt64) = fun (x: int64) -> sbyte x
7555
static member FromInt64 (_: int16 , _: FromInt64) = fun (x: int64) -> int16 x
7656
static member FromInt64 (_: byte , _: FromInt64) = fun (x: int64) -> byte x
7757
static member FromInt64 (_: uint16 , _: FromInt64) = fun (x: int64) -> uint16 x
7858
static member FromInt64 (_: uint32 , _: FromInt64) = fun (x: int64) -> uint32 x
79-
#endif
8059
static member FromInt64 (_: uint64 , _: FromInt64) = fun (x: int64) -> uint64 x
8160

8261
static member inline Invoke (x: int64) : 'Num =
@@ -128,10 +107,7 @@ type One =
128107

129108
open System
130109
open System.Text
131-
#if NET35
132-
#else
133110
open System.Threading.Tasks
134-
#endif
135111
open System.Collections.Generic
136112
open Microsoft.FSharp.Quotations
137113
open FSharpPlus.Internals.Prelude
@@ -184,15 +160,12 @@ type Zero with static member inline Zero (_: 'a*'b*'c*'d*'e , _: Zero) = (Z
184160
type Zero with static member inline Zero (_: 'a*'b*'c*'d*'e*'f , _: Zero) = (Zero.Invoke (), Zero.Invoke (), Zero.Invoke (), Zero.Invoke (), Zero.Invoke (), Zero.Invoke () ) : 'a*'b*'c*'d*'e*'f
185161
type Zero with static member inline Zero (_: 'a*'b*'c*'d*'e*'f*'g, _: Zero) = (Zero.Invoke (), Zero.Invoke (), Zero.Invoke (), Zero.Invoke (), Zero.Invoke (), Zero.Invoke (), Zero.Invoke ()) : 'a*'b*'c*'d*'e*'f*'g
186162

187-
#if NET35
188-
#else
189163
type Zero with
190164
static member inline Zero (_: Task<'a>, _: Zero) =
191165
let (v: 'a) = Zero.Invoke ()
192166
let s = TaskCompletionSource ()
193167
s.SetResult v
194168
s.Task
195-
#endif
196169

197170
static member inline Zero (_: 'T->'Monoid , _: Zero) = (fun _ -> Zero.Invoke ()) : 'T->'Monoid
198171
static member inline Zero (_: Async<'a> , _: Zero) = let (v: 'a) = Zero.Invoke () in async.Return v
@@ -303,13 +276,8 @@ type ToBigInt =
303276
static member ToBigInt (x: uint16 ) = bigint (int x)
304277
static member ToBigInt (x: unativeint) = bigint (int x)
305278
static member ToBigInt (x: bigint ) = x
306-
#if NET35
307-
static member ToBigInt (x: uint32 ) = bigint (int x)
308-
static member ToBigInt (x: uint64 ) = bigint (int64 x)
309-
#else
310279
static member ToBigInt (x: uint32 ) = bigint x
311280
static member ToBigInt (x: uint64 ) = bigint x
312-
#endif
313281

314282
static member inline Invoke (x: 'Integral) : bigint =
315283
let inline call_2 (_: ^a, b: ^b) = ((^a or ^b) : (static member ToBigInt : _ -> _) b)

0 commit comments

Comments
 (0)