Re : overloading in Haskell/Gofer 
Author Message
 Re : overloading in Haskell/Gofer

-- Perhaps you expected something like this ...

class X m where
        f :: b -> m b

type State1 s b = s -> (b,s) in g1

g1 :: b -> State1 s b
g1 x y = (x,y)

instance X (State1 s) where
        f = g1

-- Or this

data State2 s b = St (s -> (b,s))

g2 :: b -> State2 s b
g2 x = St (\y -> (x,y))

instance X (State2 s) where
        f = g2

-- Luc Duponcheel
-- Alcatel Bell Telephone, SE99
-- Francis Wellesplein 1,
-- B-2018 Antwerpen
-- Belgium

--     \_        \_\_\_    \_   \_    \_\_\_    
--      \_        \_    \_  \_   \_    \_   \_          
--       \_        \_    \_  \_   \_    \_\_\_      __o  
--        \_        \_   \_   \_   \_    \_       _`\<,_  
--         \_\_\_\_  \_\_\_    \_\_\_\_   \_   __(*)/ (*)__



Sat, 23 Dec 1995 20:04:58 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Overloading in gofer

2. Overloading function application in Gofer

3. Numericall Software in Gofer/Haskell/SML

4. Fokker's jpeg gofer code to haskell?

5. FAQ for GOFER or HASKELL

6. Is there an emacs mode for Haskell/Gofer?

7. Help with Haskell/Gofer

8. hugs/haskell/gofer/fudgets for the nt environment

9. Information about Gofer & Haskell

10. haskell/gofer pretty-printer (latex)

11. Haskell/Gofer teaching texts - summary

12. Textbooks on Gofer/Haskell?

 

 
Powered by phpBB® Forum Software