Skip to content

Commit

Permalink
Temporarily remove BaseLib dependency
Browse files Browse the repository at this point in the history
Until dotnet/fsharp#3924 is solved
  • Loading branch information
gusty committed Nov 30, 2017
1 parent 2d68bf3 commit 386ef42
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
41 changes: 20 additions & 21 deletions src/FSharpPlus/Converter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ open System.Runtime.CompilerServices
open System.Collections.Generic
open System.Text
open Microsoft.FSharp.Quotations
open FsControl.BaseLib
open FsControl.Internals
open FsControl.Internals.Prelude
open FSharpPlus
Expand Down Expand Up @@ -40,17 +39,17 @@ type Explicit =
call Unchecked.defaultof<Explicit> value

type OfBytes =
static member OfBytes (_:bool , _:OfBytes) = fun (x, i, _) -> BitConverter.ToBoolean(x, i)
static member OfBytes (_:char , _:OfBytes) = fun (x, i, e) -> BitConverter.ToChar (x, i, e)
static member OfBytes (_:float , _:OfBytes) = fun (x, i, e) -> BitConverter.ToDouble (x, i, e)
static member OfBytes (_: int16 , _:OfBytes) = fun (x, i, e) -> BitConverter.ToInt16 (x, i, e)
static member OfBytes (_: int , _:OfBytes) = fun (x, i, e) -> BitConverter.ToInt32 (x, i, e)
static member OfBytes (_:int64 , _:OfBytes) = fun (x, i, e) -> BitConverter.ToInt64 (x, i, e)
static member OfBytes (_:float32, _:OfBytes) = fun (x, i, e) -> BitConverter.ToSingle (x, i, e)
static member OfBytes (_:string , _:OfBytes) = fun (x, i, _) -> BitConverter.ToString (x, i)
static member OfBytes (_:uint16 , _:OfBytes) = fun (x, i, e) -> BitConverter.ToUInt16 (x, i, e)
static member OfBytes (_:uint32 , _:OfBytes) = fun (x, i, e) -> BitConverter.ToUInt32 (x, i, e)
static member OfBytes (_:uint64 , _:OfBytes) = fun (x, i, e) -> BitConverter.ToUInt64 (x, i, e)
static member OfBytes (_:bool , _:OfBytes) = fun (x:byte [], i, _) -> BitConverter.ToBoolean(x, i)
static member OfBytes (_:char , _:OfBytes) = fun (x:byte [], i, e) -> BitConverter.ToChar ((if BitConverter.IsLittleEndian = e then x else Array.rev x), i)
static member OfBytes (_:float , _:OfBytes) = fun (x:byte [], i, e) -> BitConverter.ToDouble ((if BitConverter.IsLittleEndian = e then x else Array.rev x), i)
static member OfBytes (_: int16 , _:OfBytes) = fun (x:byte [], i, e) -> BitConverter.ToInt16 ((if BitConverter.IsLittleEndian = e then x else Array.rev x), i)
static member OfBytes (_: int , _:OfBytes) = fun (x:byte [], i, e) -> BitConverter.ToInt32 ((if BitConverter.IsLittleEndian = e then x else Array.rev x), i)
static member OfBytes (_:int64 , _:OfBytes) = fun (x:byte [], i, e) -> BitConverter.ToInt64 ((if BitConverter.IsLittleEndian = e then x else Array.rev x), i)
static member OfBytes (_:float32, _:OfBytes) = fun (x:byte [], i, e) -> BitConverter.ToSingle ((if BitConverter.IsLittleEndian = e then x else Array.rev x), i)
static member OfBytes (_:string , _:OfBytes) = fun (x:byte [], i, _) -> BitConverter.ToString (x, i)
static member OfBytes (_:uint16 , _:OfBytes) = fun (x:byte [], i, e) -> BitConverter.ToUInt16 ((if BitConverter.IsLittleEndian = e then x else Array.rev x), i)
static member OfBytes (_:uint32 , _:OfBytes) = fun (x:byte [], i, e) -> BitConverter.ToUInt32 ((if BitConverter.IsLittleEndian = e then x else Array.rev x), i)
static member OfBytes (_:uint64 , _:OfBytes) = fun (x:byte [], i, e) -> BitConverter.ToUInt64 ((if BitConverter.IsLittleEndian = e then x else Array.rev x), i)

static member inline Invoke (isLtEndian:bool) (startIndex:int) (value:byte[]) =
let inline call_2 (a:^a, b:^b) = ((^a or ^b) : (static member OfBytes: _*_ -> _) b, a)
Expand All @@ -61,16 +60,16 @@ type OfBytes =
[<Extension;Sealed>]
type ToBytes =
[<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:char , e, _:ToBytes) = BitConverter.GetBytes(x) |> if BitConverter.IsLittleEndian = e then id else Array.rev
[<Extension>]static member ToBytes (x:float , e, _:ToBytes) = BitConverter.GetBytes(x) |> if BitConverter.IsLittleEndian = e then id else Array.rev
[<Extension>]static member ToBytes (x: int16 , e, _:ToBytes) = BitConverter.GetBytes(x) |> if BitConverter.IsLittleEndian = e then id else Array.rev
[<Extension>]static member ToBytes (x: int , e, _:ToBytes) = BitConverter.GetBytes(x) |> if BitConverter.IsLittleEndian = e then id else Array.rev
[<Extension>]static member ToBytes (x:int64 , e, _:ToBytes) = BitConverter.GetBytes(x) |> if BitConverter.IsLittleEndian = e then id else Array.rev
[<Extension>]static member ToBytes (x:float32, e, _:ToBytes) = BitConverter.GetBytes(x) |> if BitConverter.IsLittleEndian = e then id else Array.rev
[<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)
[<Extension>]static member ToBytes (x:uint16 , e, _:ToBytes) = BitConverter.GetBytes(x) |> if BitConverter.IsLittleEndian = e then id else Array.rev
[<Extension>]static member ToBytes (x:uint32 , e, _:ToBytes) = BitConverter.GetBytes(x) |> if BitConverter.IsLittleEndian = e then id else Array.rev
[<Extension>]static member ToBytes (x:uint64 , e, _:ToBytes) = BitConverter.GetBytes(x) |> if BitConverter.IsLittleEndian = e then id else Array.rev

static member inline Invoke (isLittleEndian:bool) value :byte[] =
let inline call_2 (a:^a, b:^b, e) = ((^a or ^b) : (static member ToBytes: _*_*_ -> _) b, e, a)
Expand Down
2 changes: 1 addition & 1 deletion src/FSharpPlus/FSharpPlus.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ProjectGuid>1368368e-d2f4-4fef-bb2f-492e05156e0f</ProjectGuid>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<OtherFlags Condition=" '$(TargetFramework)' == 'netstandard2.0'">--warnon:1182</OtherFlags>
<OtherFlags Condition=" '$(TargetFramework)' == 'net45'">--staticlink:FSharpPlus.BaseLib --warnon:1182</OtherFlags>
<OtherFlags Condition=" '$(TargetFramework)' == 'net45'">--warnon:1182</OtherFlags>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
Expand Down

0 comments on commit 386ef42

Please sign in to comment.