I’m writing an extension for LightGraphs.jl to calculate solutions of the eikonal equation over weighted graphs; I would like to provide for the option to use different norms when calculating solutions. Currently my setup looks like
module GraphEikonal
export graph_eikonal
export L1Norm, L2Norm, LInfNorm
using LightGraphs: AbstractGraph, outneighbors, nv
using DataStructures: PriorityQueue, dequeue!
abstract type LPNorm end
struct L1Norm <: LPNorm end
struct L2Norm <: LPNorm end
struct LInfNorm <: LPNorm end
function graph_eikonal(...; norm::LPNorm = L2Norm())
\\code calling eik_solve()
end
function eik_solve(..., norm::L1Norm)
\\code
end
function eik_solve(..,norm::L2Norm)
\\code
end
function eik_solve(...,norm::LInfNorm)
\\code
end
end
My question is basically - it seems like overkill to define these imposingly named LPNorm types, cluttering up the user’s set of imported types, just so that I can use them for dispatch, especially when the current names have nothing to do with graphs in particular - it seems like I might be stepping on other modules toes. Is there a more idiomatic way to structure the code to avoid this issue? Or should I just rename the types / not worry about it?