Nesting Just and Identity results in java.lang.ClassCastException.
- Dominant language
- Clojure
- Stars
- 970
- Forks
- 68
- PR merge metrics
- No merged PRs in 30d
Description
In cats,
```
(m/>>= (identity/identity (maybe/just 0))
(fn [x]
(m/return (m/<$> identity x))))
CompilerException java.lang.ClassCastException: cats.monad.maybe.Just cannot be cast to cats.monad.identity.Identity
```
In Haskell,
```
*Main> Identity (Just 0) >>= (\x -> return (id <$> x))
Identity (Just 0)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the shown nested Just and Identity expression, then inspect the implementations of the Just and Identity monads and their bind operations. The issue names no files or tests; done means the expression completes without ClassCastException and produces the Identity-wrapped Just result shown by the Haskell example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100