server/src/Data.hs

12 lines
200 B
Haskell
Raw Normal View History

2018-04-11 13:25:24 +02:00
{-# LANGUAGE MultiParamTypeClasses #-}
module Data (
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