on master help sign in
produce a value for (fromManyNames [])

It seems that the compiler has been handling this case for a while. I believe the code would produce the name "" on _ patterns in the past, and that name was thrown out at a later phase in compilation somehow. I suspect the function should be (fromManyNames : N -> [N] -> N) to guarantee that at least one name is given, but I do not want to get into the implications of that change at this point in time.

commit7b6e571461976679aef050de8be3cd2399ca26d5 authorEvan Czaplicki <evancz@users.noreply.github.com> dateFri 12 Jul 2019, 15:52 (7 years ago) parent8fb564a
1 file changed+9−1
compiler/src/Data/Name.hs+9−1
compiler/src/Data/Name.hs+9−1
@@ -303,7 +303,9 @@ fromManyNames :: [Name] -> Name
303303fromManyNames names =
304304 case names of
305305 [] ->
306− error "trying to use fromManyNames on an empty list"
306+ blank
307+ -- this case is needed for (let _ = Debug.log "x" x in ...)
308+ -- but maybe unused patterns should be stripped out instead
307309
308310 Utf8.Utf8 ba# : _ ->
309311 let
@@ -327,6 +329,12 @@ fromManyNames names =
327329 )
328330
329331
332+{-# NOINLINE blank #-}
333+blank :: Name
334+blank =
335+ fromWords [0x5F,0x4D,0x24] {-_M$-}
336+
337+
330338
331339-- FROM WORDS
332340