Ticket #1456: Odd.hs

File Odd.hs, 615 bytes (added by iampure@…, 8 years ago)

Complete example with some small remarks

Line 
1{-# OPTIONS_GHC -fglasgow-exts  #-}
2import Control.Monad.ST
3import Data.STRef
4
5data Q s a chain = Node s a chain
6
7data Z a  = Z  a
8val :: STRef s a -> ST s a
9val = undefined
10
11s :: Q t (Z [Char]) t1 -> [Char]
12s = undefined
13
14r :: a -> STRef s a
15r = undefined
16
17class  Zork s a b | a-> b where
18 huh:: STRef s (Q s a chain) ->  ST s ()
19
20foo k  = do
21 t <- val k
22
23 let ref_b = r t
24
25 b <- val ref_b
26 let abc = s b
27 huh ref_b
28-- foo :: (Zork t (Z [Char]) ()) => STRef t (Q t (Z [Char]) t1) -> ST t () when let abc = s b is not commented and foo :: (Zork s a b) => STRef s (Q s a chain) -> ST s () when it is commented. Why?