Remove unused Tuple value in return type.

This commit is contained in:
Dillon Kearns 2021-06-03 11:00:48 -07:00
parent e61532b73a
commit 1c2629b77e
3 changed files with 16 additions and 20 deletions

View File

@ -525,9 +525,7 @@ performStaticHttpRequests allRawResponses secrets staticRequests =
-- TODO look for performance bottleneck in this double nesting
|> List.map
(\( _, request ) ->
allRawResponses
|> StaticHttpRequest.resolveUrls ApplicationType.Cli request
|> Tuple.second
StaticHttpRequest.resolveUrls ApplicationType.Cli request allRawResponses
)
|> List.concat
-- TODO prevent duplicates... can't because Set needs comparable

View File

@ -152,23 +152,21 @@ resolve appType request rawResponses =
Ok value
resolveUrls : ApplicationType -> RawRequest value -> RequestsAndPending -> ( Bool, List (Secrets.Value Pages.StaticHttp.Request.Request) )
resolveUrls : ApplicationType -> RawRequest value -> RequestsAndPending -> List (Secrets.Value Pages.StaticHttp.Request.Request)
resolveUrls appType request rawResponses =
case request of
RequestError _ ->
( False
, []
-- TODO do I need to preserve the URLs here? -- urlList
([]
-- TODO do I need to preserve the URLs here? -- urlList
)
Request _ ( urlList, lookupFn ) ->
case lookupFn appType rawResponses of
nextRequest ->
resolveUrls appType nextRequest rawResponses
|> Tuple.mapSecond ((++) urlList)
urlList ++ resolveUrls appType nextRequest rawResponses
Done _ _ ->
( True, [] )
[]
cacheRequestResolution :

View File

@ -54,8 +54,8 @@ all =
, ( get "NEXT", "null" )
]
)
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|> Expect.equal ( True, [ getReq "first", getReq "NEXT" ] )
|> List.map Secrets.maskedLookup
|> Expect.equal [ getReq "first", getReq "NEXT" ]
)
, test "andThen staring with done" <|
\() ->
@ -71,8 +71,8 @@ all =
[ ( get "NEXT", "null" )
]
)
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|> Expect.equal ( True, [ getReq "NEXT" ] )
|> List.map Secrets.maskedLookup
|> Expect.equal [ getReq "NEXT" ]
)
, test "map" <|
\() ->
@ -91,8 +91,8 @@ all =
, ( get "NEXT", "null" )
]
)
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|> Expect.equal ( True, [ getReq "first", getReq "NEXT" ] )
|> List.map Secrets.maskedLookup
|> Expect.equal [ getReq "first", getReq "NEXT" ]
)
, test "andThen chain with 1 response available and 1 pending" <|
\() ->
@ -108,8 +108,8 @@ all =
[ ( get "first", "null" )
]
)
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|> Expect.equal ( False, [ getReq "first", getReq "NEXT" ] )
|> List.map Secrets.maskedLookup
|> Expect.equal [ getReq "first", getReq "NEXT" ]
)
, test "andThen chain with 1 response available and 2 pending" <|
\() ->
@ -130,8 +130,8 @@ all =
[ ( get "first", "1" )
]
)
|> Tuple.mapSecond (List.map Secrets.maskedLookup)
|> Expect.equal ( False, [ getReq "first", getReq "NEXT" ] )
|> List.map Secrets.maskedLookup
|> Expect.equal [ getReq "first", getReq "NEXT" ]
)
]