Skip to content

Commit

Permalink
+ Warn about unused values
Browse files Browse the repository at this point in the history
  • Loading branch information
gusty committed Dec 26, 2016
1 parent d4d97bb commit dd310ec
Show file tree
Hide file tree
Showing 24 changed files with 558 additions and 561 deletions.
226 changes: 113 additions & 113 deletions FSharpPlus/Collection.fs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion FSharpPlus/Compatibility.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module Compatibility =
type DeReference_op = DeReference_op with
static member (=>) (DeReference_op, a:'a ref ) = !a
static member (=>) (DeReference_op, a:string ) = a.ToCharArray() |> Array.toList
static member (=>) (DeReference_op, a:DeReference_op) = DeReference_op
static member (=>) (DeReference_op, _:DeReference_op) = DeReference_op

/// converts a string to list<char> otherwise still works as dereference operator.
let inline (!) a = DeReference_op => a
Expand Down
6 changes: 3 additions & 3 deletions FSharpPlus/Converter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ type OfBytes =

[<Extension;Sealed>]
type ToBytes =
[<Extension>]static member ToBytes (x:bool , e, _:ToBytes) = BitConverter.GetBytes(x)
[<Extension>]static member ToBytes (x:bool , _, _:ToBytes) = BitConverter.GetBytes(x)
[<Extension>]static member ToBytes (x:char , e, _:ToBytes) = BitConverter.GetBytes(x, BitConverter.IsLittleEndian = e)
[<Extension>]static member ToBytes (x:float , e, _:ToBytes) = BitConverter.GetBytes(x, BitConverter.IsLittleEndian = e)
[<Extension>]static member ToBytes (x: int16 , e, _:ToBytes) = BitConverter.GetBytes(x, BitConverter.IsLittleEndian = e)
[<Extension>]static member ToBytes (x: int , e, _:ToBytes) = BitConverter.GetBytes(x, BitConverter.IsLittleEndian = e)
[<Extension>]static member ToBytes (x:int64 , e, _:ToBytes) = BitConverter.GetBytes(x, BitConverter.IsLittleEndian = e)
[<Extension>]static member ToBytes (x:float32, e, _:ToBytes) = BitConverter.GetBytes(x, BitConverter.IsLittleEndian = e)
[<Extension>]static member ToBytes (x:string , e, _:ToBytes) = Array.map byte (x.ToCharArray())
[<Extension>]static member ToBytes (x:string , _, _:ToBytes) = Array.map byte (x.ToCharArray())
[<Extension>]static member ToBytes (x:uint16 , e, _:ToBytes) = BitConverter.GetBytes(x, BitConverter.IsLittleEndian = e)
[<Extension>]static member ToBytes (x:uint32 , e, _:ToBytes) = BitConverter.GetBytes(x, BitConverter.IsLittleEndian = e)
[<Extension>]static member ToBytes (x:uint64 , e, _:ToBytes) = BitConverter.GetBytes(x, BitConverter.IsLittleEndian = e)
Expand Down Expand Up @@ -176,7 +176,7 @@ type ToString with
let b = StringBuilder()
b.Append "ResizeArray " |> ignore
ToString.seqToString k "[" "]" x b
static member ToString (x:Expr<_> , _:ToString) = fun (k:CultureInfo) -> x.ToString()
static member ToString (x:Expr<_> , _:ToString) = fun (_:CultureInfo) -> x.ToString()

type ToString with static member inline ToString (x:_ seq, _:ToString) = fun (k:CultureInfo) ->
let b = StringBuilder()
Expand Down
7 changes: 3 additions & 4 deletions FSharpPlus/Extensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module List =
let singleton x = [x]
let cons x y = x :: y
let apply f x = List.collect (fun f -> List.map ((<|) f) x) f
let tails x = let rec loop = function [] -> [] | x::xs as s -> s::(loop xs) in loop x
let tails x = let rec loop = function [] -> [] | _::xs as s -> s::(loop xs) in loop x
let take i list = Seq.take i list |> Seq.toList

let skip i list =
Expand Down Expand Up @@ -93,13 +93,12 @@ module Seq =
buffer.AddRange candidate
candidate.Clear()
| seps ->
match seps |> List.tryFind (fun sep -> sep.Length = i + 1) with
| Some sep ->
if seps |> List.exists (fun sep -> sep.Length = i + 1) then
i <- 0
if options = System.StringSplitOptions.None || buffer.Count > 0 then yield buffer.ToArray() :> seq<_>
buffer.Clear()
candidate.Clear()
| _ -> i <- i + 1
else i <- i + 1
if candidate.Count > 0 then buffer.AddRange candidate
if options = System.StringSplitOptions.None || buffer.Count > 0 then yield buffer :> seq<_> }

Expand Down
2 changes: 1 addition & 1 deletion FSharpPlus/FSharpPlus.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<NoWarn>3186</NoWarn>
<OtherFlags>--staticlink:FSharpPlus.BaseLib</OtherFlags>
<OtherFlags>--staticlink:FSharpPlus.BaseLib --warnon:1182</OtherFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
Loading

0 comments on commit dd310ec

Please sign in to comment.