3 ms·
-- const [] for a HeadList quux :: a -> HeadList a quux = HeadList . (const []) *Main> HeadList "hello... no wait" >>= quux HeadList {getHeadLi
by ky3 11y ago
-- const [] for a HeadList
quux :: a -> HeadList a
quux = HeadList . (const [])
*Main> HeadList "hello... no wait" >>= quux
HeadList {getHeadList = "*** Exception: Prelude.head: empty list
Such breakage is verboten. This monad instance does not fly.