-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathTypeErrors.hs
47 lines (40 loc) · 1.06 KB
/
TypeErrors.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module TypeErrors where
-- $setup
-- >>> default ()
-- >>> :m +Polysemy
-- >>> :m +Polysemy.Output
-- >>> :m +Polysemy.Reader
-- >>> :m +Polysemy.Resource
-- >>> :m +Polysemy.State
-- >>> :m +Polysemy.Trace
-- >>> :m +Data.Maybe
--------------------------------------------------------------------------------
-- |
-- >>> :{
-- interpret @(Reader Bool) $ \case
-- Ask -> undefined
-- :}
-- ...
-- ... 'Reader Bool' is higher-order, but 'interpret' can help only
-- ... with first-order effects.
-- ...
-- ... 'interpretH' instead.
-- ...
interpretBadFirstOrder = ()
--------------------------------------------------------------------------------
-- |
-- >>> :{
-- runOutputMonoid
-- :: forall o m r a
-- . Monoid m
-- => (o -> m)
-- -> Sem (Output o ': r) a
-- -> Sem r (m, a)
-- runOutputMonoid f = runState mempty . reinterpret $ \case
-- Output o -> modify (`mappend` f o)
-- :}
-- ...
-- ... Probable cause: ...reinterpret... is applied to too few arguments
-- ...
tooFewArgumentsReinterpret = ()