Stream: ideas

Topic: using ~> for purity Inference.


view this post on Zulip Eli Dowling (Feb 21 2025 at 23:21):

I'd like to propose -> ~> as an alternative combo for purity Inference

I think we will generally write type signatures far less than actual function code. Particularly given many type annotations will be auto-generated by IDE.

=> Seems like a nice operator we may want to use elsewhere and it's easy to type.

Using ~> is just as clear, but demotes effectful function signatures to a slightly less easy to type version to free up => for grander uses.

~> is a lovely looking operator that has a certain wiggly effectfulness inherent within it. Effectful functions are a bit approximate, a bit convoluted, all this is beautifully expressed by the meandering curve of the Tilda and it's association with ~=.

view this post on Zulip Joshua Warner (Feb 21 2025 at 23:24):

On the plus side, ~> is slightly easier to type (on a US keyboard) than => or -> since it doesn't require changing the state of the shift key in the middle

view this post on Zulip Sam Mohr (Feb 21 2025 at 23:26):

The last point about how ~> is squiggly and implies an impurity is a really nice point IMO

view this post on Zulip Brendan Hansknecht (Feb 21 2025 at 23:36):

I find that really hard to differentiate at a glance.

view this post on Zulip Brendan Hansknecht (Feb 21 2025 at 23:36):

So I don't like -> paired with ~>

view this post on Zulip Sam Mohr (Feb 21 2025 at 23:36):

Fair, it's very font dependent

view this post on Zulip Brendan Hansknecht (Feb 21 2025 at 23:36):

Exactly

view this post on Zulip Eli Dowling (Feb 21 2025 at 23:38):

Look, you make a fair point... I did think it was worth at least bringing it up.

view this post on Zulip Eli Dowling (Feb 21 2025 at 23:39):

And I do wish I had more wiggles in my programming.
Lots of discussion about functional and fast in roc, sometimes I feel fun really takes a backseat :stuck_out_tongue_wink:

view this post on Zulip Brendan Hansknecht (Feb 21 2025 at 23:40):

I would be totally for it if it was more distinct in many fonts

view this post on Zulip Isaac Van Doren (Feb 22 2025 at 02:03):

On my 65% keyboard the tilde is on the same key as escape so I have to press fn to access tilde which makes it annoying to type. Of course I could remap it to remove that annoyance, but I suspect there are other people in similar situations who would be frustrated.

view this post on Zulip Elias Mulhall (Feb 22 2025 at 02:10):

Tbh I like this. It's true that the tilda is a bit hard to identify with some fonts, but a good syntax highlighter could help with that.

view this post on Zulip Fábio Beirão (Feb 22 2025 at 09:04):

I don't know if Font ligatures are still "cool", but I always end up installing FiraCode and enabling Font ligatures. So here's how -> ~> and => look with FiraCode + font ligatures:

image.png


Last updated: Jun 16 2026 at 16:19 UTC