Add resourceType function for convenience in Eff
commite5a48f4f9e6fa550f31778f15ee5ed3c730da8e2
authorEdwin Brady <ecb10@st-andrews.ac.uk>
dateTue 4 Mar 2014, 14:38 (13 years ago)
parentc2671c0
libs/neweffects/Effects.idr+4
@@ -19,6 +19,10 @@ class Handler (e : Effect) (m : Type -> Type) where
1919 handle : res -> (eff : e t res resk) ->
2020 ((x : t) -> resk x -> m a) -> m a
2121
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+
2226-- A bit of syntactic sugar ('syntax' is not very flexible so we only go
2327-- up to a small number of parameters...)
2428