External Publication
Visit Post

Empty list without list literals

Haskell Community [Unofficial] May 22, 2026
Source

I don’t think there’s a way around this for overloaded literals. In this case you could also consider a more general rewrite rule that avoids []:

{-# RULES "cons/++" forall x xs ys. (x : xs) ++ ys = x : (xs ++ ys) #-}

Another workaround is to define the rewrite rule in another module and import it.

Discussion in the ATmosphere

Loading comments...