User data type with operator contructors only

Hello all, my question probably comes from not reading manual properly. But, why is it not possible to have something like: infixr 5 :> data Stack a = a :> (Stack a) | :|| And if yes, how can I do that? I know that lists are a hack in Haskell, but anyway. Having: infixr 5 :> data Stack a = a :> (Stack a) | Bottom is not what I would like to have. :-( Thanks for any reference to/or explanation, Dusan

kolar:
Hello all,
my question probably comes from not reading manual properly. But, why is it not possible to have something like:
infixr 5 :>
data Stack a = a :> (Stack a) | :||
And if yes, how can I do that? I know that lists are a hack in Haskell,
infixr 5 :> data Stack a = a :> (Stack a) | (:||) test = 7 :> 8 :> 2 :> (:||) Not ideal, though, I suppose. -- Don

Donald Bruce Stewart wrote:
kolar:
Hello all,
my question probably comes from not reading manual properly. But, why is it not possible to have something like:
infixr 5 :>
data Stack a = a :> (Stack a) | :||
And if yes, how can I do that? I know that lists are a hack in Haskell,
infixr 5 :>
data Stack a = a :> (Stack a) | (:||)
test = 7 :> 8 :> 2 :> (:||)
Not ideal, though, I suppose.
-- Don
Hmm, I see, ghci works, but hugs not. That was my problem. Sorry for asking. I've thought this would work in both. :-( Dusan
participants (2)
-
dons@cse.unsw.edu.au
-
Dušan Kolář