Documentation for (&&) and (&&) states that they are lazy in their second argument...
[ghc.git] / testsuite / tests / typecheck / should_compile / tc250.hs
1 {-# LANGUAGE TypeFamilies #-}
2 module ShouldCompile where
3
4 import Data.Kind (Type)
5
6 class Cls a where
7 type Fam a :: Type
8 type Fam a = Maybe a
9
10 instance Cls Int where
11 -- Gets type family from default
12
13 inc :: (Fam a ~ Maybe Int) => a -> Fam a -> Fam a
14 inc _proxy (Just x) = Just (x + 1)
15 inc _proxy Nothing = Just 0
16
17 foo :: Maybe Int -> Maybe Int
18 foo = inc (undefined :: Int)