Ticket #2668: deriving.hs

File deriving.hs, 320 bytes (added by ryani, 5 years ago)
Line 
1{-# LANGUAGE StandaloneDeriving, GeneralizedNewtypeDeriving #-}
2module Deriving where
3
4class IxMonad m where
5    ret :: a -> m i i a
6
7data M s x y a = M
8data S = S
9
10instance IxMonad (M s) where ret _ = M
11
12newtype S1 x y a = S1 (M S x y a) deriving IxMonad
13
14newtype S2 x y a = S2 (M S x y a)
15deriving instance IxMonad S2