Skip to content

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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information