KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Howcome in Haskell, when there is a value that would be discarded, () is used instead of ⊥ ? Examples (can't really think of anything other than IO actions at the moment): mapM_ :: (Monad m) => (a -> m b) -> [a] -> m () foldM_ :: (Monad m) => (a -> b -> m a) -> a -> [b] -> m () writeFile :: FilePath -> String -> IO () Under strict evaluation, this makes perfect sense, but in Haskell, it only makes the domain bigger. Perhaps there are "unused parameter" functions d -> a which are strict on d (where d is an unconstrained type parameter and does not appear free in a )? Ex: seq , const' x y = y seq x .
Tags (comma-separated)
Save Edits
Cancel