How do you hide an operator when importing?

haskell

Solution

Recall how you query `ghci` for type of a function:

:t read
:t show

About operator:

Do you type `:t +`?

No, you would receive a parse error then.

You do `:t (+)`.

As for your case, you hide it with additional brackets: `((*))`

import Prelude hiding ((*))

(*) :: Int -> Int -> Int
x * 0 = 0
x * y = x + x*(y-1)

Problem

Here's my code, trying to redefine `*`. It could be achieved only when `*` previously hided: ``` import Prelude hiding (*) (*) :: Int -> Int -> Int x * 0 = 0 x * y = x + x*(y-1) ``` But it doesn't work: ``` $ ghci test.hs ``` GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help test.hs:1:24: error: parse error on input ‘*’ Failed, modules loaded: none. Prelude> I could hide other function as: ``` import Prelude hiding (read) import Prelude hiding (show) ``` while it doesn't work for operator like `*`, `+`, `-`. How do I hide them?

Original source