bitemyapp / bitemyapp/fp-course

Test for List Applicative instance is ambigious

Open
#8 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
449
Forks
89
PR merge metrics
No merged PRs in 30d

Description

The test suite for Applicative.hs accepts the following code:

(<*>) (f :. fs) xs = (f <$> xs) ++ (fs <*> xs)
(<*>) _ _ = Nil

and rejects the following code:

(<*>) (f :. fs) (x :. xs) = (f x) :. (fs <*> xs)
(<*>) _ _ = Nil

I'm under the impression that these are both valid applicative instances (I _think_ the second one is essentially the ZipList applicative instance, but I'm not actually sure).
If so, it might be useful to somehow alert the students that, while the second instance is valid, they should search for an entirely different instance (and not stare at that one and try to get it to work).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.