some-and-many Questions

5

Solved

Alternative, an extension of Applicative, declares empty, <|> and these two functions: One or more: some :: f a -> f [a] Zero or more: many :: f a -> f [a] If defined, some...
Accentor asked 7/8, 2013 at 16:23

1

We can define the continuation monad transformer as data Cont r m a = Cont {run :: (a -> m r) -> m r} We can give Cont r m an Alternative instance if m is a member of Alternative via empt...

2

Solved

What are the functions some and many in the Alternative type class useful for? Docs provide a recursive definition which I was unable to comprehend.

1

Solved

What are some and many in Control.Applicative.Alternative good for? If I write something like some $ Just 42, it seems to cause infinite recursion, which seems not very useful...
1

© 2022 - 2024 — McMap. All rights reserved.