Skip to content

Commit

Permalink
Add functional dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
zudov committed Oct 8, 2016
1 parent 57c9a38 commit dc6238d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Control/Monad/Eff/Var.purs
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ import Data.Functor.Contravariant (class Contravariant, (>$<))
import Data.Functor.Invariant (class Invariant)

-- | Typeclass for vars that can be read.
class Gettable (eff :: # !) (var :: * -> *) (a :: *) where
class Gettable (eff :: # !) (var :: * -> *) (a :: *) | var -> a, var -> eff where
get :: var a -> Eff eff a

-- | Typeclass for vars that can be written.
class Settable (eff :: # !) (var :: * -> *) (a :: *) where
class Settable (eff :: # !) (var :: * -> *) (a :: *) | var -> a, var -> eff where
set :: var a -> a -> Eff eff Unit

-- | Alias for `set`.
infixr 2 set as $=

-- | Typeclass for vars that can be updated.
class Updatable (eff :: # !) (var :: * -> *) (a :: *) where
class Updatable (eff :: # !) (var :: * -> *) (a :: *) | var -> a, var -> eff where
update :: var a -> (a -> a) -> Eff eff Unit

-- | Alias for `get`
Expand Down

0 comments on commit dc6238d

Please sign in to comment.