server/src/RW.hs

12 lines
198 B
Haskell
Raw Permalink Normal View History

2018-04-11 13:25:24 +02:00
{-# LANGUAGE MultiParamTypeClasses #-}
2019-10-13 21:52:28 +02:00
module RW (
RW(..)
2018-04-11 13:25:24 +02:00
) where
class RW a b where
get :: b -> a
2018-04-11 13:25:24 +02:00
set :: a -> b -> b
update :: (a -> a) -> b -> b
update f v =
set (f (get v)) v