Linear types: desugaring of lists
The following program fails linear lint with -dlint -O
:
{-# LANGUAGE LinearTypes #-}
module T where
f :: a %1 -> [a]
f x = [x]
The issue is that with -O
, lists are desugared to build
rather than cons in dsExplicitList
, and build
is not linear.