1 {-# LANGUAGE DefaultSignatures #-}
2 {-# LANGUAGE DeriveAnyClass #-}
3 {-# LANGUAGE DeriveGeneric #-}
4 {-# LANGUAGE FlexibleContexts #-}
5 {-# LANGUAGE FlexibleInstances #-}
6 {-# LANGUAGE ScopedTypeVariables #-}
7 {-# LANGUAGE TypeOperators #-}
10 import Data

.Proxy

(Proxy

(..))
15 print (fullyStrict

(Proxy

:: Proxy

(StrictMaybe

Bool)))
16 print (fullyStrict

(Proxy

:: Proxy

(Maybe Bool)))
18 data StrictMaybe a

= StrictNothing | StrictJust

!a

19 deriving (FullyStrict

, Generic

)
21 instance FullyStrict

Bool
22 instance FullyStrict a

=> FullyStrict

(Maybe a

)
24 class FullyStrict a

where
25 fullyStrict

:: proxy a

-> Bool
26 default fullyStrict

:: (GFullyStrict

(Rep a

)) => proxy a

-> Bool
27 fullyStrict _

= gfullyStrict

(Proxy

:: Proxy

(Rep a p

))
29 class GFullyStrict f

where
30 gfullyStrict

:: proxy

(f p

) -> Bool
32 instance GFullyStrict V1

where
35 instance GFullyStrict U1

where
38 instance FullyStrict c

=> GFullyStrict

(Rec0 c

) where
39 gfullyStrict _

= fullyStrict

(Proxy

:: Proxy c

)
41 instance GFullyStrict f

=> GFullyStrict

(D1 c f

) where
42 gfullyStrict _

= gfullyStrict

(Proxy

:: Proxy

(f p

))
44 instance GFullyStrict f

=> GFullyStrict

(C1 c f

) where
45 gfullyStrict _

= gfullyStrict

(Proxy

:: Proxy

(f p

))
47 instance (GFullyStrict f

, Selector c

) => GFullyStrict

(S1 c f

) where
48 gfullyStrict _

= gfullyStrict

(Proxy

:: Proxy

(f p

))
49 && selDecidedStrictness

(undefined :: S1 c f p

) /= DecidedLazy

51 instance (GFullyStrict f

, GFullyStrict g

) => GFullyStrict

(f

:+: g

) where
53 gfullyStrict

(Proxy

:: Proxy

(f p

)) && gfullyStrict

(Proxy

:: Proxy

(g p

))
55 instance (GFullyStrict f

, GFullyStrict g

) => GFullyStrict

(f

:*: g

) where
57 gfullyStrict

(Proxy

:: Proxy

(f p

)) && gfullyStrict

(Proxy

:: Proxy

(g p

))