Hacker News new | ask | show | jobs
by ky3 3839 days 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.