summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc251.hs
blob: bf9ef34787905a560b794d0971504d0de85599b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{-# LANGUAGE TypeFamilies #-}
module ShouldCompile where

import Tc251_Help

instance Cls Int where

inc :: (Fam a ~ Maybe Int) => a -> Fam a -> Fam a
inc _proxy (Just x) = Just (x + 1)
inc _proxy Nothing  = Just 0

foo :: Maybe Int -> Maybe Int
foo = inc (undefined :: Int)