summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T10340.hs
blob: c35c7150ce8ecac6c3beaed162541e9f875b9290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}

module T10340 where

import GHC.Exts (Any)

class MonadState s m where
  get :: m s

newtype State s a = State (s -> (s, a))

instance MonadState s (State s) where
  get = State $ \s -> (s, s)

foo :: State Any Any
foo = get