X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Flib%2Fexts%2FLazyST.lhs;h=29c7814cc6b45f82e83f1855027fc5ac976d862a;hb=748ebf79f2e1ec73370b7beb70ad8d9376e0dcdc;hp=1d9cf6063468de7d1ce8fc6866030f16db317cac;hpb=994019420daa6226ac33a52fdb063d56b46ef066;p=ghc-hetmet.git diff --git a/ghc/lib/exts/LazyST.lhs b/ghc/lib/exts/LazyST.lhs index 1d9cf60..29c7814 100644 --- a/ghc/lib/exts/LazyST.lhs +++ b/ghc/lib/exts/LazyST.lhs @@ -39,6 +39,14 @@ import PrelGHC newtype ST s a = ST (PrelST.State s -> (a,PrelST.State s)) +instance Functor (ST s) where + map f m = ST $ \ s -> + let + ST m_a = m + (r,new_s) = m_a s + in + (f r,new_s) + instance Monad (ST s) where return a = ST $ \ s -> (a,s)