Skip to content

Commit

Permalink
Adapting to new List type (part 37).
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Jun 10, 2024
1 parent f4cf6ad commit 8326a79
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
["%" \\injection]]
[collection
["[0]" list (.use "[1]#[0]" functor mix)]
["[0]" stack (.use "[1]#[0]" functor mix)]
["[0]" stack]
["[0]" dictionary (.only Dictionary)]
["[0]" set (.only Set)]]]
[math
Expand Down Expand Up @@ -173,7 +173,7 @@
(|> it
(list#each as_text)
(text.interposed " ")
(text.enclosed ["(list" ")"]))
(text.enclosed ["(list " ")"]))

{#Seq left right}
(text "(& " (as_text left) " " (as_text right) ")")
Expand Down Expand Up @@ -219,25 +219,24 @@
... Tuple patterns can be exhaustive if there is exhaustiveness for all of
... their sub-patterns.
{//pattern.#Complex {//complex.#Tuple membersP+}}
(when (list.as_stack (list.reversed membersP+))
(^.or (stack)
(stack _))
(when (list.reversed membersP+)
(^.or (list)
(list _))
(exception.except ..invalid_tuple [(list.size membersP+)])

{.#Top lastP prevsP+}
(do [! try.monad]
[lastC (coverage lastP)]
(stack.mix' !
(function (_ leftP rightC)
(do !
[leftC (coverage leftP)]
(when rightC
{#Exhaustive}
(in leftC)

_
(in {#Seq leftC rightC}))))
lastC prevsP+)))
members
(list.mix' try.monad
(function (_ leftP rightC)
(do try.monad
[leftC (coverage leftP)]
(when rightC
{#Exhaustive}
(in leftC)

_
(in {#Seq leftC rightC}))))
{#Exhaustive}
members))

{//pattern.#List it}
(|> it
Expand Down Expand Up @@ -457,7 +456,7 @@
{.#None}
(when (stack.reversed possibilitiesSF')
{.#Top last prevs}
(in (stack#mix (function (_ left right) {#Alt left right})
(in (stack.mix (function (_ left right) {#Alt left right})
last
prevs))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
["%" \\injection]]
[collection
["[0]" list (.use "[1]#[0]" monad)]
["[0]" stack (.use "[1]#[0]" mix)]]]
["[0]" stack]]]
[math
[number
["n" natural]]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1522,17 +1522,17 @@
(|>> {#Pass})
(|>> {#Hint}))
(method_signature method_style method)))))))]
(when (list.as_stack (list.all pass candidates))
(stack method)
(in method)

(stack)
(when (list.all pass candidates)
(list)
(analysis.except ..no_candidates [actual_class_tvars class_name method_name actual_method_tvars inputsJT (list.all hint candidates)])

{.#Top method alternatives}
(list method)
(in method)

every_valid_candidate
(if allow_inheritance?
(in method)
(analysis.except ..too_many_candidates [actual_class_tvars class_name method_name actual_method_tvars inputsJT (list.of_stack {.#Top method alternatives})])))))
(in (.list_item# 0 every_valid_candidate))
(analysis.except ..too_many_candidates [actual_class_tvars class_name method_name actual_method_tvars inputsJT every_valid_candidate])))))

(the constructor_method
"<init>")
Expand Down

0 comments on commit 8326a79

Please sign in to comment.