3 ms·
as my program might not use math or 'mathematical jargon' I would expect the tree shaker to eliminate all math as dead code but if my program happens to draw t
by mmphosis 5y ago
as my program might not use math or 'mathematical jargon' I would expect the tree shaker to eliminate all math as dead code
but if my program happens to draw the sword of math beware! I am never going to understand Haskell, or should I say ∵⌷⊃○⌽⍉⌊⍟⊖∇⍫⍒∆
- toastal 5y agoThat's not a very Haskell thing to see that many Unicode operators. Are you thinking Agda or APL? At least in PureScript, all infix operators must have word name and is either a list of ASCII symbols or a single Unicode character. And even still, you see a massive amount of programmers abusing (and misusing) ligature fonts to make their code look more like math without embracing Unicode and the actual symbols. Why fight over composition operator being `.` or `<<` or `<<<` when you can use the one from math, `∘`? Using Vim, use the digraph `Ctrl+k` then `Ob` and now you have a `∘`.
- smichel17 5y agoHaskell is, however, fond of custom `operators' (infix functions made of symbols). For example, take <$>. It's barely even shorter than fmap! And Haskell even has a special syntax if you want to make fmap infix. Is it really worth the characters to write a <$> b instead of (1 char longer) fmap a b or (3 chars longer) a `fmap` b I understand fmap, but <$> tripped me up for an embarrassingly long time when trying to read Haskell code. In any other language, I'd do a web search for the function I didn't understand, to learn more about it, but that doesn't work here because most search engines don't handle symbols well. You have to know to use Hoogle. But someone who's trying to teach themselves Haskell isn't just going to know that. Learning Haskell doesn't have to be harder than learning another language, but it does require inordinately more hand-holding. I'm sure I'm not the only one. This is something I would call an "inessential weirdness"[0] of Haskell. There is a whole host of others— <>, $, and >>= are some from the Prelude alone; it becomes especially tricky when people don't use explicit or qualified imports. [0]: A term I learned from this excellent talk, https://harihareswara.net/texts/inessential-weirdnesses-in-free-software-libreplanet-talk-2016/ https://harihareswara.net/texts/inessential-weirdnesses-in-f... which you can watch at https://media.libreplanet.org/u/libreplanet/m/inessential-weirdnesses-in-free-software/ https://media.libreplanet.org/u/libreplanet/m/inessential-we...
- tome 5y agoYou can search for <$> fine on Google. The top hit is a Stack Overflow question "What does <$> mean in Haskell?". https://www.google.com/search?hl=en&q=%3C%24%3E https://www.google.com/search?hl=en&q=%3C%24%3E https://stackoverflow.com/questions/37286376/what-does-mean-in-haskell/37286470 https://stackoverflow.com/questions/37286376/what-does-mean-...