diff options
author | konsumlamm <konsumlamm@gmail.com> | 2023-04-25 03:01:32 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-05-09 22:23:23 -0400 |
commit | 7788c09c787fce817cf5a44c34ba538a39388c1c (patch) | |
tree | a25fa90f8b87b71f786860d51fe4461789692848 /libraries/base/Data/Function.hs | |
parent | 0657b4820bb0ff2811b27c510204996ec3d31898 (diff) | |
download | haskell-7788c09c787fce817cf5a44c34ba538a39388c1c.tar.gz |
Make `(&)` representation polymorphic in the return type
Diffstat (limited to 'libraries/base/Data/Function.hs')
-rw-r--r-- | libraries/base/Data/Function.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libraries/base/Data/Function.hs b/libraries/base/Data/Function.hs index 35c0b7d657..9cda5628f7 100644 --- a/libraries/base/Data/Function.hs +++ b/libraries/base/Data/Function.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE ExplicitForAll #-} +{-# LANGUAGE PolyKinds #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_HADDOCK print-explicit-runtime-reps #-} @@ -28,7 +30,7 @@ module Data.Function , applyWhen ) where -import GHC.Base ( ($), (.), id, const, flip ) +import GHC.Base ( TYPE, ($), (.), id, const, flip ) import Data.Bool ( Bool(..) ) infixl 0 `on` @@ -120,7 +122,7 @@ on :: (b -> b -> c) -> (a -> b) -> a -> a -> c -- "6" -- -- @since 4.8.0.0 -(&) :: a -> (a -> b) -> b +(&) :: forall r a (b :: TYPE r). a -> (a -> b) -> b x & f = f x -- | 'applyWhen' applies a function to a value if a condition is true, |