danidiaz / dep-t

Dependency injection for records-of-functions.
http://hackage.haskell.org/package/dep-t
BSD 3-Clause "New" or "Revised" License
8 stars 2 forks source link

Explore Data.Tagged to disambiguate between components of the same type #16

Closed danidiaz closed 2 years ago

danidiaz commented 2 years ago

tagged

I'm thinking of somehting like

Tagged "thing" (MyComponent m)

and then

call (someMethod .  untag @Name) arg1 arg2 ... 

Will that work? Will it play well with existing machinery like adviseRecord?

danidiaz commented 2 years ago

Looks like regular Tagged won't do. We need one with three parameters: the tag, the component, the monad. Like Tagged "thing" MyComponent m. Should it be added to Dep.Has?

danidiaz commented 2 years ago

Added in 3ad381beb6aff43f825d1c8cef6f208bcf66a98f.