From 8cfa4be975cb966cabf02a8a3cb6169552a4ecec Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Tue, 30 Mar 2021 17:53:17 -0700 Subject: [PATCH] Rename init to succeed. --- src/Glob.elm | 4 ++-- tests/GlobTests.elm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Glob.elm b/src/Glob.elm index 8314b139..f7c9cfdc 100644 --- a/src/Glob.elm +++ b/src/Glob.elm @@ -16,8 +16,8 @@ type CaptureToValue a | Dynamic (String -> a) -init : constructor -> Glob constructor -init constructor = +succeed : constructor -> Glob constructor +succeed constructor = Glob "" (\captures -> constructor) diff --git a/tests/GlobTests.elm b/tests/GlobTests.elm index 3df48fa1..457cf4c7 100644 --- a/tests/GlobTests.elm +++ b/tests/GlobTests.elm @@ -10,7 +10,7 @@ all = describe "glob" [ test "literal" <| \() -> - Glob.init identity + Glob.succeed identity |> Glob.keep (Glob.literal "hello") |> expect { captures = [] @@ -19,7 +19,7 @@ all = } , test "capture" <| \() -> - Glob.init identity + Glob.succeed identity |> Glob.keep Glob.star |> Glob.drop (Glob.literal ".txt") |> expect @@ -29,7 +29,7 @@ all = } , test "oneOf" <| \() -> - Glob.init Tuple.pair + Glob.succeed Tuple.pair |> Glob.keep Glob.star |> Glob.drop (Glob.literal ".") |> Glob.keep @@ -79,7 +79,7 @@ all = zeroOrMoreGlob : Glob.Glob (Maybe String) zeroOrMoreGlob = - Glob.init identity + Glob.succeed identity |> Glob.drop (Glob.literal "test/a") |> Glob.keep (Glob.zeroOrMore [ "a", "b" ]) |> Glob.drop (Glob.literal "/x.js")