non-alphabetical mathematical symbols as non-infix function names

(¬) :: Bool → Bool (¬) q = not q q = True ¬ q : parser error on input q ¬ : parser error (possibly incorrect indentation) (¬ q) : Couldn't match expected type `Bool -> t' against inferred type `Bool' In the expression: (� True) In the definition of `it': it = (� True) * (q ¬) : False (Why) is it not possible to define a (non-infix) function whose name consists of a single non-alphabetical mathematical symbol? ¬ :: Bool → Bool -- parser error on input ** ¬ q = not q -- parser error on input ** Cetin Sert

MigMit:~ MigMit$ ghci GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> let {(¬) :: Bool -> Bool; (¬) = not} Prelude> (¬) True False On 22 Jan 2008, at 09:03, Cetin Sert wrote:
(¬) :: Bool → Bool (¬) q = not q
q = True ¬ q : parser error on input q ¬ : parser error (possibly incorrect indentation) (¬ q) : Couldn't match expected type `Bool -> t' against inferred type `Bool' In the expression: (� True) In the definition of `it': it = (� True) * (q ¬) : False
(Why) is it not possible to define a (non-infix) function whose name consists of a single non-alphabetical mathematical symbol?
¬ :: Bool → Bool -- parser error on input ** ¬ q = not q -- parser error on input **
Cetin Sert _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Tue, 2008-01-22 at 07:03 +0100, Cetin Sert wrote:
(¬) :: Bool → Bool (¬) q = not q
q = True ¬ q : parser error on input q ¬ : parser error (possibly incorrect indentation) (¬ q) : Couldn't match expected type `Bool -> t' against inferred type `Bool' In the expression: (� True) In the definition of `it': it = (� True) * (q ¬) : False
(Why) is it not possible to define a (non-infix) function whose name consists of a single non-alphabetical mathematical symbol?
Haskell does not support user-defined unary prefix operators, only infix. The only one is prefix negation -n. Duncan
participants (3)
-
Cetin Sert
-
Duncan Coutts
-
Miguel Mitrofanov