mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Generate code for recursive nullable wrapped lambda sets
This commit is contained in:
parent
0f73c25c0c
commit
3f532df981
5 changed files with 246 additions and 2 deletions
|
@ -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"
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue