Skip to content

Commit

Permalink
Merge pull request #1 from thebritican/master
Browse files Browse the repository at this point in the history
update prelude; refreeze; run dhall-1.33 formatter
  • Loading branch information
Gabriella439 authored Jul 5, 2020
2 parents 7f5b7bf + c977cf4 commit 2d44ae6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Prelude.dhall
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
https://prelude.dhall-lang.org/v10.0.0/package.dhall sha256:771c7131fc87e13eb18f770a27c59f9418879f7e230ba2a50e46f4461f43ec69
? https://prelude.dhall-lang.org/v10.0.0/package.dhall
https://prelude.dhall-lang.org/v17.0.0/package.dhall sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e
? https://prelude.dhall-lang.org/v17.0.0/package.dhall
24 changes: 11 additions & 13 deletions render.dhall
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Render a semantic version as `Text`

let Prelude =
./Prelude.dhall sha256:771c7131fc87e13eb18f770a27c59f9418879f7e230ba2a50e46f4461f43ec69
./Prelude.dhall sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e
? ./Prelude.dhall

let SemanticVersion =
Expand All @@ -10,27 +10,25 @@ let SemanticVersion =

let renderSuffix
: Text List Text Text
= λ(prefix : Text)
λ(ts : List Text)
if Prelude.List.null Text ts

= λ(prefix : Text)
λ(ts : List Text)
if Prelude.List.null Text ts
then ""

else "${prefix}${Prelude.Text.concatSep "." ts}"

let render
: SemanticVersion Text
= λ(v : SemanticVersion)
let X = Natural/show v.major
= λ(v : SemanticVersion)
let X = Natural/show v.major

let Y = Natural/show v.minor

let Z = Natural/show v.patch

let pre-release = renderSuffix "-" v.pre-release

let build = renderSuffix "+" v.build

in "${X}.${Y}.${Z}${pre-release}${build}"

let example =
Expand Down
20 changes: 10 additions & 10 deletions version.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ let render =
? ./render.dhall

let version
: (major : Natural)
(minor : Natural)
(patch : Natural)
SemanticVersion
= λ(major : Natural)
λ(minor : Natural)
λ(patch : Natural)
{ major = major
, minor = minor
, patch = patch
: (major : Natural)
(minor : Natural)
(patch : Natural)
SemanticVersion
= λ(major : Natural)
λ(minor : Natural)
λ(patch : Natural)
{ major
, minor
, patch
, build = [] : List Text
, pre-release = [] : List Text
}
Expand Down

0 comments on commit 2d44ae6

Please sign in to comment.