Skip to content

Couldn't match type ‘IO’ with ‘Data.Functor.Identity.Identity’ #2

@TheOddler

Description

@TheOddler

I'm getting the following error in the Image example:

     Couldn't match type IO with Data.Functor.Identity.Identity
        arising from a functional dependency between:
          constraint ArrowSchedule
                        (S.SystemT Data.Functor.Identity.Identity)
                        (Aztecs.ECS.Schedule.ScheduleT (A.AccessT IO))
            arising from a use of system
          instance ArrowSchedule (S.SystemT m) (Schedule m)
            at <no location info>
     In the first argument of (>>>), namely system IMG.setup
      In the second argument of (>>>), namely
        system IMG.setup
           >>>
             system setup
               >>>
                 forever_
                   (IMG.load >>> SDL.update >>> system IMG.draw >>> SDL.draw)
      In the expression:
        SDL.setup
          >>>
            system IMG.setup
              >>>
                system setup
                  >>>
                    forever_ (IMG.load >>> SDL.update >>> system IMG.draw >>> SDL.draw)

I was getting this in the Window example, but was able to fix it by changing the type of setup to setup :: S.SystemT IO () ().

However, in the Image example it's using the IMG.setup system which comes from Aztecs.SDL.Image so I cannot change that. Seems I need to be able to map SystemT Identity () () to SystemT IO () () somehow, but doesn't seem to be some kind of lift function?

I'm unfamiliar with arrows, and relatively new to monad transformers, so I might be missing something obvious?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions