mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-23 16:28:02 +03:00
pending test for #528
This commit is contained in:
parent
d4da8afbb0
commit
173aad36d3
36
unison-src/tests/fix528.uu
Normal file
36
unison-src/tests/fix528.uu
Normal file
@ -0,0 +1,36 @@
|
||||
-- needs Base.u
|
||||
|
||||
use Trie tail head
|
||||
|
||||
type Trie k v = { head : Optional v, tail : Map k (Trie k v) }
|
||||
|
||||
Trie.empty = Trie None Map.empty
|
||||
|
||||
Trie.toList : Trie k v -> [([k], v)]
|
||||
Trie.toList t =
|
||||
go : [k] -> Trie k v -> [([k], v)]
|
||||
go path t =
|
||||
here = case Trie.head t of
|
||||
Optional.None -> []
|
||||
Optional.Some v -> [(path, v)]
|
||||
tail t |> Map.toList
|
||||
|> List.map (p -> go (path `snoc` at1 p) (at2 p))
|
||||
|> List.join
|
||||
|> (List.++) here
|
||||
go [] t
|
||||
|
||||
> toList Trie.empty
|
||||
|
||||
---
|
||||
|
||||
bombs with:
|
||||
|
||||
💔💥
|
||||
|
||||
I stopped evaluation after encountering an error:
|
||||
|
||||
user error (type error, expecting List, got: (Lam 1 FormClosure 5MQKGmyVUfJMTmaGyk8TBmLJMoZbUKGDE4fgKBhAMzMkmwpweM7gsPPUivFuY4PeMM1Qrt7e2RnAs2sw4QJzsqjJ Ref(##List.++) [[]] (Leaf External:ExternalFunction)))
|
||||
|
||||
I'm sorry this message doesn't have more detail
|
||||
about the location of the failure. My makers plan to
|
||||
fix this in a future release. 😢
|
Loading…
Reference in New Issue
Block a user