"Lazy in the spine, strict in leaves" is a property of the API, not a (simple) property of the data structure. Here is an example of how it can search for lists:
module StrictList (StrictList, runStrictList, nil, cons, uncons, repeat) where
newtype StrictList a = StrictList { runStrictList :: [a] }
nil :: StrictList a
nil = StrictList []
cons :: a -> StrictList a -> StrictList a
cons x (StrictList xs) = x `seq` StrictList (x:xs)
uncons :: StrictList a -> Maybe (a, StrictList a)
uncons (StrictList []) = Nothing
uncons (StrictList (x:xs)) = Just (x, StrictList xs)
repeat :: a -> StrictList a
repeat x = x `seq` StrictList (let xs = x:xs in xs)
, API - , , . , , repeat, ( !), , - . , , ( , ).
, -, - -, -; fromList :: [a] -> StrictList a , :
fromList (repeat x) = repeat xrunStrictList (fromList xs) = xs xs.
( , repeat).