2018-04-11 13:25:24 +02:00
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
|
|
|
module Data (
|
2019-08-24 23:29:40 +02:00
|
|
|
RW(..)
|
2018-04-11 13:25:24 +02:00
|
|
|
) where
|
|
|
|
|
|
|
|
class RW a b where
|
2018-05-11 12:31:53 +02:00
|
|
|
get :: b -> a
|
2018-04-11 13:25:24 +02:00
|
|
|
set :: a -> b -> b
|
2018-05-11 12:31:53 +02:00
|
|
|
update :: (a -> a) -> b -> b
|
|
|
|
update f v =
|
|
|
|
set (f (get v)) v
|