Skip to content

Error when trying to derive Arrow (Kleisli m) #6

@koflerdavid

Description

@koflerdavid

Hello,

today I played around with Djinn a bit, and noticed what I am pretty sure is a bug:
I added a definition for an Arrow typeclass, and the Kleisli wrapper for a Monad.
Then, I tried to derive an instance Arrow (Kleisli m).

Input:

Djinn> class Arrow arr where id :: arr a a; (.) :: arr b c -> arr a b -> arr a c; toArr :: (b -> c) -> arr b c; first :: arr b c -> arr (b, d) (c, d)
Djinn> data Kleisli m a b = MkKleisli (a -> m b)
Djinn> ?instance Arrow (Kleisli m)

Expected result: an instance Arrow (Kleisli m) or a message that this is not possible.
Actual result: an error:

Djinn> ?instance Arrow (Kleisli m)
instance Arrow (Kleisli m) where
djinn: IntMap.!: key 3 is not an element of the map
CallStack (from HasCallStack):
error, called at libraries/containers/Data/IntMap/Internal.hs:569:17 in containers-0.5.10.2:Data.IntMap.Internal

I'll try to shrink the example, but so far this is all I have.

Best regards,
David Kofler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions