FSharp.UMX icon indicating copy to clipboard operation
FSharp.UMX copied to clipboard

Converting to string and performing string operation

Open cartermp opened this issue 6 years ago • 4 comments

There's also a more general question about conversations, but should something like this be possible?

image

Fails to build as well so it's not an Ionide quirk.

cartermp avatar Feb 06 '19 18:02 cartermp

You'd have to use let str = UMX.untag file or let str : string = %file. @eiriktsarpalis Maybe a second operator could be added specifically for untag? It should be a fairly common operation.

rojepp avatar Feb 06 '19 21:02 rojepp

While there are use cases where sprinkling % and other operators around might be appropriate, I feel having the type paired with a module of specific named conversion operators a la the normal to* and of* functions might be more sustainable (it also gets you out of having open FSharp.UMX all over the place).

I have some usages here that use % and just enough type hints.

bartelink avatar Feb 06 '19 22:02 bartelink

Maybe a second operator could be added specifically for untag?

Because these operators have to be defined using SRTP magic, using a dedicated operator for untagging would not solve the problem.

eiriktsarpalis avatar Feb 07 '19 08:02 eiriktsarpalis

I think I prefer UMX.untag to another operator.

cartermp avatar Feb 07 '19 17:02 cartermp