Rename intercalate to concatSep (#74)

This uses Nix's naming convention for consistency
This commit is contained in:
Gabriel Gonzalez 2017-06-17 08:49:04 -07:00 committed by GitHub
parent 45a7f8cbb7
commit 5afee37868
2 changed files with 14 additions and 14 deletions

View File

@ -1,15 +1,15 @@
{-
Combine a `List` of `Text` values with a separator in between each value
Concatenate a `List` of `Text` values with a separator in between each value
Examples:
```
./intercalate ", " ["ABC", "DEF", "GHI"] = "ABC, DEF, GHI"
./concatSep ", " ["ABC", "DEF", "GHI"] = "ABC, DEF, GHI"
./intercalate ", " ([] : List Text) = ""
./concatSep ", " ([] : List Text) = ""
```
-}
let intercalate : ∀(separator : Text) → ∀(elements : List Text) → Text
let concatSep : ∀(separator : Text) → ∀(elements : List Text) → Text
= λ(separator : Text)
→ λ(elements : List Text)
→ let status
@ -40,4 +40,4 @@ let intercalate : ∀(separator : Text) → ∀(elements : List Text) → Text
}
status : Text
in intercalate
in concatSep

View File

@ -236,9 +236,9 @@ exampleTests =
[ _Text_concat_0
, _Text_concat_1
]
, Test.Tasty.testGroup "intercalate"
[ _Text_intercalate_0
, _Text_intercalate_1
, Test.Tasty.testGroup "concatSep"
[ _Text_concatSep_0
, _Text_concatSep_1
]
]
]
@ -1139,16 +1139,16 @@ _Text_concat_1 = Test.Tasty.HUnit.testCase "Example #1" (do
|]
Util.assertNormalizesTo e "\"\"" )
_Text_intercalate_0 :: TestTree
_Text_intercalate_0 = Test.Tasty.HUnit.testCase "Example #0" (do
_Text_concatSep_0 :: TestTree
_Text_concatSep_0 = Test.Tasty.HUnit.testCase "Example #0" (do
e <- Util.code [NeatInterpolation.text|
./Prelude/Text/intercalate ", " ["ABC", "DEF", "GHI"]
./Prelude/Text/concatSep ", " ["ABC", "DEF", "GHI"]
|]
Util.assertNormalizesTo e "\"ABC, DEF, GHI\"" )
_Text_intercalate_1 :: TestTree
_Text_intercalate_1 = Test.Tasty.HUnit.testCase "Example #1" (do
_Text_concatSep_1 :: TestTree
_Text_concatSep_1 = Test.Tasty.HUnit.testCase "Example #1" (do
e <- Util.code [NeatInterpolation.text|
./Prelude/Text/intercalate ", " ([] : List Text)
./Prelude/Text/concatSep ", " ([] : List Text)
|]
Util.assertNormalizesTo e "\"\"" )