[Haskell-cafe] Re: Overriding a Prelude function?
barsoap at web.de
Wed Apr 22 21:52:42 EDT 2009
michael rice <nowgate at yahoo.com> wrote:
> OK, I changed the operator from (>>) to (~>>). When I try to use it I
> get this:
> [michael at localhost ~]$ ghci rand
> GHCi, version 6.10.1: http://www.haskell.org/ghc/__ :? for help
> Loading package ghc-prim ... linking ... done.
> Loading package integer ... linking ... done.
> Loading package base ... linking ... done.
> [1 of 1] Compiling Main________________________ ( rand.hs, interpreted )
> Ok, modules loaded: Main.
> *Main> rollDie ~>> (rollDie ~>> rollDie)
> ______ No instance for (Show (Seed -> (Int, Seed)))
> __________ arising from a use of `print' at <interactive>:1:0-32
> ______ Possible fix:
> __________ add an instance declaration for (Show (Seed -> (Int, Seed)))
> ______ In a stmt of a 'do' expression: print it
Well, you obviously need an initial seed:
rollDie 0xdeadbeef ~>> (rollDie ~>> rollDie)
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.
More information about the Haskell-Cafe