Rename init to succeed.

This commit is contained in:
Dillon Kearns 2021-03-30 17:53:17 -07:00
parent 7cf2bbaba4
commit 8cfa4be975
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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")