morphir-elm icon indicating copy to clipboard operation
morphir-elm copied to clipboard

Consider supporting elm/url

Open kmudrick opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

I'd love to be able to leverage the elm/url package - in particular, the ability to do url encoding and decoding

Describe the solution you'd like

Being able to import/use elm/url or the equivalent from Morphir

I've considered implementing the function I need (percentEncode) in pure elm using the EcmaScript spec for the equivalent (which is what the Elm Kernel seems to use under the covers anyway)

kmudrick avatar Feb 08 '24 22:02 kmudrick

@stephengoldbaum and @AttilaMihaly I actually think exposing a Url type is useful for Morphir, use of a Url for location and indexing concepts have come up in various business scenarios as Url is about addressing not just web work.

I'd be happy to submit a PR to add this.

DamianReeves avatar Feb 08 '24 22:02 DamianReeves

This is like UUID in terms of structured string types. Should we add each of these as unique types or add support for Typed Strings like Bosque has?

On Thu, Feb 8, 2024 at 11:40 PM Damian Reeves @.***> wrote:

@stephengoldbaum https://github.com/stephengoldbaum and @AttilaMihaly https://github.com/AttilaMihaly I actually think exposing a Url type is useful for Morphir, use of a Url for location and indexing concepts have come up in various business scenarios as Url is about addressing not just web work.

I'd be happy to submit a PR to add this.

— Reply to this email directly, view it on GitHub https://github.com/finos/morphir-elm/issues/1140#issuecomment-1935047047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7SPJF7B4CBNZCB4NAUA3YSVH6TAVCNFSM6AAAAABDARHRTSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVGA2DOMBUG4 . You are receiving this because you were mentioned.Message ID: @.***>

stephengoldbaum avatar Feb 12 '24 10:02 stephengoldbaum

Can we represent a URL as a custom type in user code? Something like this:

type alias URL =
  { scheme : Scheme
  , authority : Authority
  , path : Path
  , query : Query
  , fragment : Fragment
  }

I didn't get into the details of each part because I just wanted to demonstrate the idea.

I think we should start thinking in terms of an extension mechanism that allows people to add new libraries to extend the SDK because otherwise we will have maintenance issues.

AttilaMihaly avatar Feb 13 '24 08:02 AttilaMihaly

We did try this but there are limits to what we support at the API layer. I think we should consider what are the base types we support so we can move to the model you are suggesting @AttilaMihaly . But I don't think we are there yet, for both UUID and URL we are missing vital parts crucial to constructing these things.

DamianReeves avatar Feb 13 '24 14:02 DamianReeves