Skip to content

Commit

Permalink
normalize api, use Result in all target frameworks (#41)
Browse files Browse the repository at this point in the history
remove usage of `Choice` in `net`, use `Result` instead

bump version to v0.31
  • Loading branch information
enricosada authored Feb 10, 2019
1 parent fcba7d1 commit c8527fa
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="15.0">

<PropertyGroup>
<Version Condition=" '$(Version)' == '' ">0.30.0$(VersionSuffix)</Version>
<Version Condition=" '$(Version)' == '' ">0.31.0$(VersionSuffix)</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
17 changes: 0 additions & 17 deletions src/Dotnet.ProjInfo/Inspect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,6 @@ module Dotnet.ProjInfo.Inspect
open System
open System.IO

#if NET461
let inline internal Ok x = Choice1Of2 x
let inline internal Error x = Choice2Of2 x

let inline internal (|Ok|Error|) x =
match x with
| Choice1Of2 x -> Ok x
| Choice2Of2 e -> Error e

type internal Result<'Ok,'Err> = Choice<'Ok,'Err>

module internal Result =
let map f inp = match inp with Error e -> Error e | Ok x -> Ok (f x)
let mapError f inp = match inp with Error e -> Error (f e) | Ok x -> Ok x
let bind f inp = match inp with Error e -> Error e | Ok x -> f x
#endif

module MSBuild =
type MSbuildCli =
| Property of string * string
Expand Down
4 changes: 0 additions & 4 deletions src/Dotnet.ProjInfo/NETFrameworkInfoFromMSBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ module Dotnet.ProjInfo.NETFrameworkInfoFromMSBuild
open System
open System.IO

#if NET461
open Dotnet.ProjInfo.Inspect
#endif

open Dotnet.ProjInfo.Inspect.MSBuild

let createEnvInfoProj () =
Expand Down

0 comments on commit c8527fa

Please sign in to comment.