Generate code for recursive nullable wrapped lambda sets

This commit is contained in:
Ayaz Hafiz 2023-03-27 10:10:15 -05:00
parent 0f73c25c0c
commit 3f532df981
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
5 changed files with 246 additions and 2 deletions

View file

@ -2822,3 +2822,26 @@ fn recursive_lambda_set_resolved_only_upon_specialization() {
"#
)
}
#[mono_test]
fn compose_recursive_lambda_set_productive_nullable_wrapped() {
indoc!(
r#"
app "test" provides [main] to "./platform"
compose = \forward -> \f, g ->
if forward
then \x -> g (f x)
else \x -> f (g x)
identity = \x -> x
exclame = \s -> "\(s)!"
whisper = \s -> "(\(s))"
main =
res: Str -> Str
res = List.walk [ exclame, whisper ] identity (compose Bool.true)
res "hello"
"#
)
}