mikesol/purescript-hyrule

Aliasing Behaviours?

Closed this issue ยท 3 comments

Behaviors

Or Behaviours if you're in ๐Ÿ‡ฌ๐Ÿ‡ง, ๐Ÿ‡ฎ๐Ÿ‡ช, ๐Ÿ‡ฆ๐Ÿ‡บ, ๐Ÿ‡จ๐Ÿ‡ฆ, ๐Ÿ‡ฟ๐Ÿ‡ฆ, ๐Ÿ‡ณ๐Ÿ‡ฟ, ๐Ÿ‡ง๐Ÿ‡ผ, ๐Ÿ‡ฌ๐Ÿ‡ฒ, ๐Ÿ‡ณ๐Ÿ‡ฆ, ๐Ÿ‡ฟ๐Ÿ‡ฒ, ...

โ€” Deku Docs, https://purescript-deku.netlify.app/functional-reactive-programming/behaviors

This is a bit weird TBH. Dialect v. nation one is currently located in aside, it looks like you spotted an issue by calling it out to begin with.

Could you imagine the burden of aliasing to worth it for accessibility for users? Iโ€™m of the โ€œbehaviorsโ€ camp myself, but Iโ€™ve watched coworkers struggle with dialectal issues with CSS and fingering a โ€œcolourโ€ to get syntax errors. I mean look at this weirdness in JavaScript @ AnalyserNode which I have spelled wrong a couple of times under the assumption that most Web APIs take on American English, or the annoyance of Nix with its --optimise flag I always spell wrong. It is not a good feeling when to you something is spelled correctly but the spellchecker or compiler tell you that you are wrong.

module FRP.Behaviour where

import FRP.Behavior

type ABehaviour = ABehavior

type Behaviour = Behavior

-- etc.

As a precendence, the Erlang language seemlessly supports both behavior and behaviour as keywords (and oddly Purerl had decided only behaviour was valid).

Drawbacks: extra code to maintain, could be harder to use like Pursuit to find something (but for others it could be easier if they did not assume they should use a dialect they do not speak).


Useless anecdote: a while back I proposed semi-seriously a sigil like % to denote an alternate spelling to make this sort of thing better supported by docs which folks found silly

%myBehaviour
myBehavior โˆท โˆ€ a. a โ†’ Unit
myBehavior _ = unit

I'll leave this open but wait to make a change until someone requests it based on an issue they have using the lib.

Renamed to Poll, which I believe is spelled that way in all dialects of English! ๐Ÿ‡ฌ๐Ÿ‡ง ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‘ฝ (they speak English too... sometimes...)