[Haskell-cafe] Re: [Haskell-beginners] map question

Jon Fairbairn jon.fairbairn at cl.cam.ac.uk
Fri Sep 18 05:09:39 EDT 2009


Ketil Malde <ketil at malde.org> writes:

> Gregory Propf <gregorypropf at yahoo.com> writes:
>
>> Heh, perhaps we should petition to have a new computer key and symbol
>> added to the world's way of writing maths, something like maybe a
>> downward angled slash to mean prefix (-)  
>
> Or just use 'negate' and 'subtract'?

Well, now that ghc accepts unicode characters in programme source, we
could ask that ¬ (NOT SIGN, U+00AC) be recategorised as an identifier
character and use that (as a simple function name) for negation and lose
the wart altogether.

class Negatable t where
      ¬ :: t -> t

(and as a side effect we could have identifiers like slightly¬dodgy).

Or, if we want to make things look even nicer, make ‐ (HYPHEN, U+2010)
an identifier character and use − (MINUS SIGN, U+2212) for the infix
operator. Now we could have hyphenated‐identifiers too.

I think this second option would be the ㊣ (CORRECT, U+32A3) thing to
do, though editors and so on would have to be changed to make the
distinction readily visible.

I think it's Friday, but I'm not entirely sure this is silly.

-- 
Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk



More information about the Haskell-Cafe mailing list