moocfi / haskell-mooc

Haskell MOOC University of Helsinki
Other
307 stars 414 forks source link

Fix section 15.9 quiz #74

Closed yaxollum closed 1 year ago

yaxollum commented 1 year ago

For the last question of the Section 15.9 quiz:

λ> pure 3 <* pure 4 :: Validation Int Ok 3 λ> pure 3 <|> pure 4 :: Validation Int Ok 3

λ> pure 3 <* pure 4 :: [Int] [3] λ> pure 3 <|> pure 4 :: [Int] [3,4]



For the `[]` Applicative, `pure 3 <* pure 4` produces `[3]`, whereas `pure 3 <|> pure 4` produces `[3,4]`.
opqdonut commented 1 year ago

thanks!