From 336614d8fc815d5eec7461ed271ae45697d9216c Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sun, 17 Mar 2019 22:34:47 +0000 Subject: Handle module select calls on non-literal modules --- src/any.gleam | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/any.gleam b/src/any.gleam index 22dd0d5..5deaeb8 100644 --- a/src/any.gleam +++ b/src/any.gleam @@ -172,17 +172,17 @@ pub external fn thunk(Any) -> Result(fn() -> Any, String) //// |> expect:is_error //// } -// external fn list_any(Any) -> Result(List(Any), String) = "gleam__stdlib" "decode_list" +external fn list_any(Any) -> Result(List(Any), String) = "gleam__stdlib" "decode_list" -// fn list_module() { -// list -// } +fn list_module() { + list +} -// pub fn list(any, decode) { -// any -// |> list_any -// |> result:then(_, fn(x) { list_module():traverse(x, decode) }) -// } +pub fn list(any, decode) { + any + |> list_any + |> result:then(_, fn(x) { list_module():traverse(x, decode) }) +} //// test list { //// let _ = [] -- cgit v1.2.3