funcool / funcool/cats

Nesting Just and Identity results in java.lang.ClassCastException.

Open
#188 1 comment 0 reactions 0 assignees View on GitHub
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.