Skip to content

Add image to docs/src/map_interface.md and some related decisions #2103

@fingolfin

Description

@fingolfin

Right now docs/src/map_interface.md says this:

It is also necessary to be able to apply a map. This amounts to overloading the call
method for objects belonging to `Map(MyMap)`.

```julia
(M::Map(MyMap)(a))
```

Personally I'd prefer if we changed this to say something like this

It is also necessary to be able to apply a map. This amounts to providing an `image
method for objects belonging to `Map(MyMap)`.

```julia
image(M::Map(MyMap), a)
```

(Actually the next bit then probably should be turned into a docstring for image, but that's yet another matter...)

And then we can providing a single method that implements "function call style invocation" in terms of image for all map types:

function (f::Map{D, C})(a) where {D, C}
  return image(f, a)::elem_type(C)
end

Then slightly later in the .md file mention that besides image(f,a) one can also write f(a).

Finally of course we must look at Nemo, Hecke, Oscar to see if there are more maps where we want to define image -- but I think this won't be breaking for anyone as long as we don't change places which could in principle handle arbitrary Map subtypes to use image instead of function call syntax...


BTw the whole Map(MyMap) funny business is something we may wish to replace at some point anyway. I feel like we should overhaul some of the map / homomorphism business anyway (definitely need to do it for group homomorphisms). Ah well

Originally posted by @fingolfin in #2095 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    docThis change adds or pertains to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions