liquidhaskell-0.9.0.2.1: tests/pos/StructRec.hs
module StructRec () where
{-@ autosize OList @-}
data OList a =
Mt
| Ln{h :: a, t :: OList a}
{-@ data OList a =
Mt
| Ln{h :: a, t :: OList {v:a | h <= v}} @-}
insert :: (Ord a) => a -> OList a -> OList a
insert y Mt = Ln y Mt
insert y (Ln x xs)
| y <= x = Ln y (Ln x xs)
| otherwise = Ln x (insert y xs)