on master help sign in
Add resourceType function for convenience in Eff
e5a48f4Edwin Brady
libs/neweffects/Effects.idr+4
@@ -19,6 +19,10 @@ class Handler (e : Effect) (m : Type -> Type) where
19 handle : res -> (eff : e t res resk) ->
19 handle : res -> (eff : e t res resk) ->
20 ((x : t) -> resk x -> m a) -> m a
20 ((x : t) -> resk x -> m a) -> m a
21
21
22+-- Get the resource type (handy at the REPL to find out about an effect)
23+resourceType : EFFECT -> Type
24+resourceType (MkEff t e) = t
25+
22-- A bit of syntactic sugar ('syntax' is not very flexible so we only go
26-- A bit of syntactic sugar ('syntax' is not very flexible so we only go
23-- up to a small number of parameters...)
27-- up to a small number of parameters...)
24
28