-- | An Iso that is not necessarily surjective; as well as takes an (unchanging)-- context value.typePartialIsoctxsa=(ctx->a->s,ctx->s->Maybea)partialIsoIsLawful::PartialIsoctxsa->ctx->[a]->BoolpartialIsoIsLawful(to,from)ctx=all$\a->lets=toctxainJusta==fromctxs
Really curious about the best way to do isomorphism check, but with allowance for Maybe:
decodeRoute . encodeRoute = id
in principle, but that Maybe is preventing us from treating this as isomorphism. What can be done here?What's this https://github.com/hanshoglund/iso-deriving/blob/master/test/Spec.hs
https://github.com/schernichkin/partial-isomorphisms/blob/master/src/Control/Isomorphism/Partial/Unsafe.hs
https://www.mathematik.uni-marburg.de/~rendel/rendel10invertible.pdf
Hackish,
I think that paper will obviate needing a
partialIsoIsLawful
.If I treat decoding routes as parsing, and encoding route as pretty-printing - that paper is super relevant to this problem.
More from Julien: https://github.com/srid/ema/issues/78#issuecomment-1036993190
Julien again, re: improving
PartialIso
: https://git.code.sourcephile.fr/~julm/webc/tree/mainctx: https://github.com/srid/ema/issues/78#issuecomment-1041189041
whoa - this could be used defined bijecetive route encoders? https://hackage.haskell.org/package/invertible-0.2.0.7/docs/Control-Invertible-Monoidal.html