summaryrefslogtreecommitdiff
path: root/testsuite/tests/parser/should_compile/T12862.hs
blob: 0a9f13f4710c59841df8600f25769a10f8869ba6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE TypeFamilies, InstanceSigs #-}
{-# LANGUAGE BangPatterns #-}  -- should parse even with BangPatterns enabled

module T12862 where

import Data.Kind (Type)

class Key key where
  data TotalMap key :: Type -> Type
  (!) :: TotalMap key val -> (key -> val)

instance Key Bool where
  data TotalMap Bool val = BoolMap val val
  (!) :: TotalMap Bool val -> (Bool -> val)
  (BoolMap f _) ! False = f   -- with parentheses
  BoolMap f _ ! True = f      -- without parentheses